mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
#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:
parent
94da1d6a21
commit
e2a902c669
1 changed files with 3 additions and 5 deletions
|
@ -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'.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue