Patch by Gerrit Holl to avoid doing two stat() calls in a row in walk().

This commit is contained in:
Guido van Rossum 2000-02-28 14:27:07 +00:00
parent 0ba33002e1
commit 84a74595f7
1 changed files with 2 additions and 1 deletions

View File

@ -267,7 +267,8 @@ def walk(top, func, arg):
for name in names:
if name not in exceptions:
name = join(top, name)
if isdir(name) and not islink(name):
st = os.lstat(name)
if stat.S_ISDIR(st[stat.ST_MODE]):
walk(name, func, arg)