]> granicus.if.org Git - python/commitdiff
#1696393: don't check for '.' and '..' in ntpath.walk since
authorGeorg Brandl <georg@python.org>
Sun, 6 Jan 2008 14:17:36 +0000 (14:17 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 6 Jan 2008 14:17:36 +0000 (14:17 +0000)
they aren't returned from os.listdir anymore.
Reported by Michael Haggerty.

Lib/ntpath.py

index 06b2293293ee1cb179cb04aa50a8b4dcb2392d64..fa2fc29970d9e0fe25a416cadff71881b5cb670b 100644 (file)
@@ -254,12 +254,10 @@ def walk(top, func, arg):
     except os.error:
         return
     func(arg, top, names)
-    exceptions = ('.', '..')
     for name in names:
-        if name not in exceptions:
-            name = join(top, name)
-            if isdir(name):
-                walk(name, func, arg)
+        name = join(top, name)
+        if isdir(name):
+            walk(name, func, arg)
 
 
 # Expand paths beginning with '~' or '~user'.