#1696393: don't check for '.' and '..' in ntpath.walk since

they aren't returned from os.listdir anymore.
Reported by Michael Haggerty.
This commit is contained in:
Georg Brandl 2008-01-06 14:17:36 +00:00
parent 94da1d6a21
commit e2a902c669
1 changed files with 3 additions and 5 deletions

View 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'.