mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-19 00:54:42 +04:00
Update util in attempt to fix return type check everywhere.
This commit is contained in:
parent
839f7f2f04
commit
6967f3cb5c
1 changed files with 2 additions and 3 deletions
|
|
@ -206,8 +206,7 @@ def _handle_readonly(
|
||||||
func: Callable[[str], object],
|
func: Callable[[str], object],
|
||||||
path: str,
|
path: str,
|
||||||
exc: OSError,
|
exc: OSError,
|
||||||
object: object = None, # Ignored.
|
):
|
||||||
) -> None:
|
|
||||||
if (
|
if (
|
||||||
func in (os.rmdir, os.remove, os.unlink) and
|
func in (os.rmdir, os.remove, os.unlink) and
|
||||||
exc.errno in {errno.EACCES, errno.EPERM}
|
exc.errno in {errno.EACCES, errno.EPERM}
|
||||||
|
|
@ -224,7 +223,7 @@ if sys.version_info < (3, 12): # pragma: <3.12 cover
|
||||||
func: Callable[[str], object],
|
func: Callable[[str], object],
|
||||||
path: str,
|
path: str,
|
||||||
excinfo: tuple[type[OSError], OSError, TracebackType],
|
excinfo: tuple[type[OSError], OSError, TracebackType],
|
||||||
) -> None:
|
):
|
||||||
return _handle_readonly(func, path, excinfo[1])
|
return _handle_readonly(func, path, excinfo[1])
|
||||||
|
|
||||||
def rmtree(path: str) -> None:
|
def rmtree(path: str) -> None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue