Skip to content

Commit

Permalink
util: use set instead of tuple in errno check
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Fischer <70564747+paulhfischer@users.noreply.github.com>
  • Loading branch information
fsouza and paulhfischer committed Dec 6, 2020
1 parent bb0d957 commit c598785
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pre_commit/util.py
Expand Up @@ -255,7 +255,7 @@ def handle_remove_readonly(
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)
Expand Down

0 comments on commit c598785

Please sign in to comment.