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:
francisco souza
2020-12-06 07:45:31 -08:00
committed by GitHub
parent bb0d9573a9
commit c598785b6f

View File

@@ -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)