mirror of
https://github.com/python/cpython.git
synced 2025-12-05 00:52:25 +00:00
Remove some redundant logic from walk() -- there's no need to check
for "." and "..", since listdir() no longer returns those.
This commit is contained in:
parent
1b6d21bb3e
commit
a9b2b4be26
1 changed files with 0 additions and 2 deletions
|
|
@ -263,9 +263,7 @@ of all the files and subdirs in directory "d".
|
||||||
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)
|
||||||
st = os.lstat(name)
|
st = os.lstat(name)
|
||||||
if stat.S_ISDIR(st[stat.ST_MODE]):
|
if stat.S_ISDIR(st[stat.ST_MODE]):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue