]> arthur.barton.de Git - bup.git/commitdiff
pylint: replace multiple errno comparisons with "in"
authorRob Browning <rlb@defaultvalue.org>
Sun, 11 Sep 2022 20:03:33 +0000 (15:03 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 11 Sep 2022 20:07:30 +0000 (15:07 -0500)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/helpers.py
lib/bup/metadata.py

index 3636c13ef4136fd2e00bcf9bdddeefb5608c60dc..81770339e4955543a498b134f7ad0b329a83c9b6 100644 (file)
@@ -856,7 +856,7 @@ if _mincore:
             try:
                 m = io.mmap(fd, msize, mmap.MAP_PRIVATE, 0, 0, pos)
             except mmap.error as ex:
-                if ex.errno == errno.EINVAL or ex.errno == errno.ENODEV:
+                if ex.errno in (errno.EINVAL, errno.ENODEV):
                     # Perhaps the file was a pipe, i.e. "... | bup split ..."
                     return None
                 raise ex
index 7e8329cd8f6db3b58cdd827794ed195280f6c7b3..b2e3ed996028e7006c0e64a8c3a1c68b403e8db9 100644 (file)
@@ -573,7 +573,7 @@ class Metadata:
                 # (or group) doesn't exist
                 raise ApplyError("POSIX1e ACL: can't create %r for %r"
                                  % (acls, path_msg(path)))
-            elif e.errno == errno.EPERM or e.errno == errno.EOPNOTSUPP:
+            elif e.errno in (errno.EPERM, errno.EOPNOTSUPP):
                 raise ApplyError('POSIX1e ACL applyto: %s' % e)
             else:
                 raise
@@ -695,8 +695,7 @@ class Metadata:
                 try:
                     xattr.set(path, k, v, nofollow=True)
                 except IOError as e:
-                    if e.errno == errno.EPERM \
-                            or e.errno == errno.EOPNOTSUPP:
+                    if e.errno in (errno.EPERM, errno.EOPNOTSUPP):
                         raise ApplyError('xattr.set %r: %s' % (path_msg(path), e))
                     else:
                         raise