Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a9b2b4b

Browse files
committed
Remove some redundant logic from walk() -- there's no need to check
for "." and "..", since listdir() no longer returns those.
1 parent 1b6d21b commit a9b2b4b

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

Lib/posixpath.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,7 @@ def walk(top, func, arg):
263263
except os.error:
264264
return
265265
func(arg, top, names)
266-
exceptions = ('.', '..')
267266
for name in names:
268-
if name not in exceptions:
269267
name = join(top, name)
270268
st = os.lstat(name)
271269
if stat.S_ISDIR(st[stat.ST_MODE]):

0 commit comments

Comments
 (0)