mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Merge pull request #1725 from fsouza/fix-rmtree
util: also run chmod on EPERM
This commit is contained in:
commit
cf604f6b93
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 == errno.EACCES
|
||||
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