Skip to content

Commit e0f2f34

Browse files
authored
Merge pull request #26 from fcollonval/patch-1
Correct hidden folder removal
2 parents 5e4181a + 414d379 commit e0f2f34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jupyterlab-snippets/loader.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ def collect_snippets(self):
1616
for root_path in self.snippet_paths:
1717
for dirpath, dirnames, filenames in os.walk(root_path, followlinks=True):
1818
# Remove hidden folder
19-
for folder_i, folder in enumerate(dirnames):
20-
if folder.startswith("."):
21-
dirnames.pop(folder_i)
19+
to_remove = [folder for folder in dirnames if folder.startswith(".")]
20+
for folder in to_remove:
21+
dirnames.remove(folder)
2222

2323
for f in filenames:
2424
fullpath = PurePath(dirpath).relative_to(root_path).joinpath(f)

0 commit comments

Comments
 (0)