Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c598785

Browse files
fsouzapaulhfischer
andauthored
util: use set instead of tuple in errno check
Co-authored-by: Paul Fischer <[email protected]>
1 parent bb0d957 commit c598785

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pre_commit/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def handle_remove_readonly(
255255
excvalue = exc[1]
256256
if (
257257
func in (os.rmdir, os.remove, os.unlink) and
258-
excvalue.errno in (errno.EACCES, errno.EPERM)
258+
excvalue.errno in {errno.EACCES, errno.EPERM}
259259
):
260260
for p in (path, os.path.dirname(path)):
261261
os.chmod(p, os.stat(p).st_mode | stat.S_IWUSR)

0 commit comments

Comments
 (0)