diff options
author | Guido van Rossum <guido@python.org> | 2000-02-28 14:27:07 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-02-28 14:27:07 +0000 |
commit | 4db86ecb343321d0fb97f83f63bddf1273b86284 (patch) | |
tree | e015381e080e958d73eaa4f04ae035a118499046 | |
parent | c0ec96773c7bf89712f94ebe503291ef7d7a6fdf (diff) | |
download | cpython-4db86ecb343321d0fb97f83f63bddf1273b86284.tar.gz |
Patch by Gerrit Holl to avoid doing two stat() calls in a row in walk().
-rw-r--r-- | Lib/posixpath.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py index 792a9856d5..cc0e4cba1f 100644 --- a/Lib/posixpath.py +++ b/Lib/posixpath.py @@ -267,7 +267,8 @@ of all the files and subdirs in directory "d". 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) |