summaryrefslogtreecommitdiffstats
path: root/Lib/posixpath.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-02-28 14:27:07 (GMT)
committerGuido van Rossum <guido@python.org>2000-02-28 14:27:07 (GMT)
commit84a74595f784c5a6f8138bed0235a5b86d175edb (patch)
tree1cb141ff47e48d1d603e34cc1ad9c87ad3c52581 /Lib/posixpath.py
parent0ba33002e1df4627901f3303574554f239789a1a (diff)
downloadcpython-84a74595f784c5a6f8138bed0235a5b86d175edb.zip
cpython-84a74595f784c5a6f8138bed0235a5b86d175edb.tar.gz
cpython-84a74595f784c5a6f8138bed0235a5b86d175edb.tar.bz2
Patch by Gerrit Holl to avoid doing two stat() calls in a row in walk().
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r--Lib/posixpath.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index 792a985..cc0e4cb 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)