Skip to content

Commit 6ddac39

Browse files
committed
Ignore some lines for coverage
1 parent b9be144 commit 6ddac39

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

setuptools/_shutil.py

+5-3
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':

0 commit comments

Comments
 (0)