Skip to content

Commit e588f89

Browse files
committed
Ignore some lines for coverage
1 parent 8421e5d commit e588f89

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

setuptools/_shutil.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
try:
1212
from os import chmod # pyright: ignore[reportAssignmentType]
1313
# Losing type-safety w/ pyright, but that's ok
14-
except ImportError:
14+
except ImportError: # pragma: no cover
1515
# Jython compatibility
1616
def chmod(*args: object, **kwargs: object) -> None: # type: ignore[misc] # Mypy reuses the imported definition anyway
1717
pass
@@ -24,12 +24,14 @@ def attempt_chmod_verbose(path, mode):
2424
log.debug("changing mode of %s to %o", path, mode)
2525
try:
2626
chmod(path, mode)
27-
except OSError as e:
27+
except OSError as e: # pragma: no cover
2828
log.debug("chmod failed: %s", e)
2929

3030

3131
# Must match shutil._OnExcCallback
32-
def _auto_chmod(func: Callable[..., _T], arg: str, exc: BaseException) -> _T:
32+
def _auto_chmod(
33+
func: Callable[..., _T], arg: str, exc: BaseException
34+
) -> _T: # pragma: no cover
3335
"""shutils onexc callback to automatically call chmod for certain functions."""
3436
# Only retry for scenarios known to have an issue
3537
if func in [os.unlink, os.remove] and os.name == 'nt':

setuptools/command/egg_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def run(self):
311311

312312
# Get rid of native_libs.txt if it was put there by older bdist_egg
313313
nl = os.path.join(staging, "native_libs.txt")
314-
if os.path.exists(nl):
314+
if os.path.exists(nl): # pragma: no cover
315315
self.delete_file(nl)
316316

317317
# Remove old directory and create the new one

0 commit comments

Comments
 (0)