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
# (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
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