Skip to content

Commit 6326078

Browse files
authored
Update template discovery to make its order deterministic
Template files are discovered on the system using os.walk, which does not guarantee deterministic order. This commit makes their order consistent by sorting them by path in lexicographic order.
1 parent ab9cbe9 commit 6326078

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

jupyterlab_templates/extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def get_templates(self):
5454
)
5555
)
5656
# pull contents and push into templates list
57-
for f, dirname, filename in files:
57+
for f, dirname, filename in sorted(files):
5858
# skips over faild attempts to read content
5959
try:
6060
with open(os.path.join(abspath, f), "r", encoding="utf8") as fp:

0 commit comments

Comments
 (0)