
python-checkins at python
Nov 19, 2009, 8:20 PM
Post #1 of 1
(144 views)
Permalink
|
|
r76429 - python/trunk/Lib/os.py
|
|
Author: benjamin.peterson Date: Fri Nov 20 03:56:43 2009 New Revision: 76429 Log: avoid function import Modified: python/trunk/Lib/os.py Modified: python/trunk/Lib/os.py ============================================================================== --- python/trunk/Lib/os.py (original) +++ python/trunk/Lib/os.py Fri Nov 20 03:56:43 2009 @@ -263,7 +263,7 @@ dirs.remove('CVS') # don't visit CVS directories """ - from os.path import join, isdir, islink + islink, join, isdir = path.islink, path.join, path.isdir # We may not have read permission for top, in which case we can't # get a list of the files the directory contains. os.path.walk @@ -289,9 +289,9 @@ if topdown: yield top, dirs, nondirs for name in dirs: - path = join(top, name) - if followlinks or not islink(path): - for x in walk(path, topdown, onerror, followlinks): + new_path = join(top, name) + if followlinks or not islink(new_path): + for x in walk(new_path, topdown, onerror, followlinks): yield x if not topdown: yield top, dirs, nondirs _______________________________________________ Python-checkins mailing list Python-checkins [at] python http://mail.python.org/mailman/listinfo/python-checkins
|