for n in os.listdir('.'):
try:
st = xstat.lstat(n)
- except OSError, e:
- add_error(Exception('%s: %s' % (realpath(n), str(e))))
+ except OSError as e:
+ add_error(Exception('%s: %s' % (resolve_parent(n), str(e))))
continue
if (st.st_mode & _IFMT) == stat.S_IFDIR:
n += '/'
else:
try:
OsFile(name).fchdir()
- except OSError, e:
+ except OSError as e:
add_error('%s: %s' % (prepend, e))
else:
for i in _recursive_dirlist(prepend=prepend+name, xdev=xdev,
if stat.S_ISLNK(pst.st_mode):
yield (path, pst)
continue
- except OSError, e:
+ except OSError as e:
add_error('recursive_dirlist: %s' % e)
continue
try:
pfile = OsFile(path)
- except OSError, e:
+ except OSError as e:
add_error(e)
continue
pst = pfile.stat()