In some simple testing, there didn't appear to be any notable,
consistent performance difference, and the S_IFMT(0xffffffff) call
fails with an OverflowError on at least macos.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
def stat(self):
return xstat.fstat(self.fd)
-
-_IFMT = stat.S_IFMT(0xffffffff) # avoid function call in inner loop
def _dirlist():
l = []
for n in os.listdir(b'.'):
except OSError as e:
add_error(Exception('%s: %s' % (resolve_parent(n), str(e))))
continue
- if (st.st_mode & _IFMT) == stat.S_IFDIR:
+ if stat.S_ISDIR(st.st_mode):
n += b'/'
l.append((n,st))
l.sort(reverse=True)
return l
-
def _recursive_dirlist(prepend, xdev, bup_dir=None,
excluded_paths=None,
exclude_rxs=None,