]> granicus.if.org Git - python/commitdiff
Patch by Gerrit Holl to avoid doing two stat() calls in a row in walk().
authorGuido van Rossum <guido@python.org>
Mon, 28 Feb 2000 14:27:07 +0000 (14:27 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 28 Feb 2000 14:27:07 +0000 (14:27 +0000)
Lib/posixpath.py

index 792a9856d5d1f9c82e9283976a566394c5a2d06f..cc0e4cba1ff767b387bff1becb856fefc2c00221 100644 (file)
@@ -267,7 +267,8 @@ of all the files and subdirs in directory "d".
     for name in names:
         if name not in exceptions:
             name = join(top, name)
-            if isdir(name) and not islink(name):
+            st = os.lstat(name)
+            if stat.S_ISDIR(st[stat.ST_MODE]):
                 walk(name, func, arg)