diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 05:33:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 05:33:24 +0000 |
commit | b0bcd1c3ad465da1d50bc47dd6afc8a77c21a85e (patch) | |
tree | da8add9478f5d2ce59a5179e85f6b4c15c395964 /pre_commit/util.py | |
parent | Releasing debian version 3.7.0-1. (diff) | |
download | pre-commit-b0bcd1c3ad465da1d50bc47dd6afc8a77c21a85e.tar.xz pre-commit-b0bcd1c3ad465da1d50bc47dd6afc8a77c21a85e.zip |
Merging upstream version 3.7.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/util.py')
-rw-r--r-- | pre_commit/util.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pre_commit/util.py b/pre_commit/util.py index b3682d4..b75c84a 100644 --- a/pre_commit/util.py +++ b/pre_commit/util.py @@ -205,10 +205,11 @@ else: # pragma: no cover def _handle_readonly( func: Callable[[str], object], path: str, - exc: OSError, + exc: Exception, ) -> None: if ( func in (os.rmdir, os.remove, os.unlink) and + isinstance(exc, OSError) and exc.errno in {errno.EACCES, errno.EPERM} ): for p in (path, os.path.dirname(path)): @@ -222,7 +223,7 @@ if sys.version_info < (3, 12): # pragma: <3.12 cover def _handle_readonly_old( func: Callable[[str], object], path: str, - excinfo: tuple[type[OSError], OSError, TracebackType], + excinfo: tuple[type[Exception], Exception, TracebackType], ) -> None: return _handle_readonly(func, path, excinfo[1]) |