mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-15 13:30:17 -06: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user