File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 11
11
try :
12
12
from os import chmod # pyright: ignore[reportAssignmentType]
13
13
# Losing type-safety w/ pyright, but that's ok
14
- except ImportError :
14
+ except ImportError : # pragma: no cover
15
15
# Jython compatibility
16
16
def chmod (* args : object , ** kwargs : object ) -> None : # type: ignore[misc] # Mypy reuses the imported definition anyway
17
17
pass
@@ -24,12 +24,14 @@ def attempt_chmod_verbose(path, mode):
24
24
log .debug ("changing mode of %s to %o" , path , mode )
25
25
try :
26
26
chmod (path , mode )
27
- except OSError as e :
27
+ except OSError as e : # pragma: no cover
28
28
log .debug ("chmod failed: %s" , e )
29
29
30
30
31
31
# 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
33
35
"""shutils onexc callback to automatically call chmod for certain functions."""
34
36
# Only retry for scenarios known to have an issue
35
37
if func in [os .unlink , os .remove ] and os .name == 'nt' :
You can’t perform that action at this time.
0 commit comments