Skip to content

Commit 7890921

Browse files
committed
Fix bug in get_files to make recusion control work
1 parent 13e3749 commit 7890921

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sc2reader/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,9 @@ def get_files( path, regex=None, exclude=[],
557557
files = list()
558558
for root, directories, filenames in os.walk(path, followlinks=followlinks):
559559
# Exclude the indicated directories by removing them from `directories`
560-
for index,directory in enumerate(directories):
560+
for directory in list(directories):
561561
if directory in exclude or depth == 0:
562-
del directories[index]
562+
directories.remove(directory)
563563

564564
# Extend our return value only with the allowed file type and regex
565565
allowed_files = filter(allow, filenames)

0 commit comments

Comments
 (0)