mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
util: use set instead of tuple in errno check
Co-authored-by: Paul Fischer <70564747+paulhfischer@users.noreply.github.com>
This commit is contained in:
parent
bb0d9573a9
commit
c598785b6f
1 changed files with 1 additions and 1 deletions
|
|
@ -255,7 +255,7 @@ def rmtree(path: str) -> None:
|
|||
excvalue = exc[1]
|
||||
if (
|
||||
func in (os.rmdir, os.remove, os.unlink) and
|
||||
excvalue.errno in (errno.EACCES, errno.EPERM)
|
||||
excvalue.errno in {errno.EACCES, errno.EPERM}
|
||||
):
|
||||
for p in (path, os.path.dirname(path)):
|
||||
os.chmod(p, os.stat(p).st_mode | stat.S_IWUSR)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue