From: Avery Pennarun Date: Tue, 9 Feb 2010 05:02:58 +0000 (-0500) Subject: drecurse.py: handle initial pathnames that aren't directories. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8584edb60cb6e5412622addd4f165a5be19f6a70;p=packages%2Fb%2Fbup.git drecurse.py: handle initial pathnames that aren't directories. --- diff --git a/drecurse.py b/drecurse.py index b62e58a..33bcca4 100644 --- a/drecurse.py +++ b/drecurse.py @@ -67,8 +67,15 @@ def recursive_dirlist(paths, xdev): assert(type(paths) != type('')) for path in paths: try: - rpath = os.path.realpath(path) - pfile = OsFile(rpath) + pst = os.lstat(path) + if stat.S_ISLNK(pst.st_mode): + yield (path, pst) + continue + except OSError, e: + add_error(e) + continue + try: + pfile = OsFile(path) except OSError, e: add_error(e) continue