Skip to content

Commit

Permalink
Fix PyCQA#108
Browse files Browse the repository at this point in the history
  • Loading branch information
glennmatthews committed Feb 19, 2015
1 parent 286f4ff commit abb3d44
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pep257.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,8 @@ def collect(names, match=lambda name: True, match_dir=lambda name: True):
for name in names: # map(expanduser, names):
if os.path.isdir(name):
for root, dirs, filenames in os.walk(name):
for dir in dirs:
if not match_dir(dir):
dirs.remove(dir) # do not visit those dirs
# Skip any dirs that do not match match_dir
dirs[:] = [dir for dir in dirs if match_dir(dir)]
for filename in filenames:
if match(filename):
yield os.path.join(root, filename)
Expand Down

0 comments on commit abb3d44

Please sign in to comment.