#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

View file

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