Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit abb3d44

Browse files
committed
Fix #108
1 parent 286f4ff commit abb3d44

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pep257.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,8 @@ def collect(names, match=lambda name: True, match_dir=lambda name: True):
474474
for name in names: # map(expanduser, names):
475475
if os.path.isdir(name):
476476
for root, dirs, filenames in os.walk(name):
477-
for dir in dirs:
478-
if not match_dir(dir):
479-
dirs.remove(dir) # do not visit those dirs
477+
# Skip any dirs that do not match match_dir
478+
dirs[:] = [dir for dir in dirs if match_dir(dir)]
480479
for filename in filenames:
481480
if match(filename):
482481
yield os.path.join(root, filename)

0 commit comments

Comments
 (0)