Skip to content

Commit 3a0a3be

Browse files
authored
Merge pull request #88 from hedgert/deterministic-list-files
Make list_files() traversal deterministic
2 parents 76a03b8 + 8ba96b4 commit 3a0a3be

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎tests/test_unasync.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
def list_files(startpath):
1818
output = ""
1919
for root, dirs, files in os.walk(startpath):
20+
dirs.sort()
21+
files.sort()
2022
level = root.replace(startpath, "").count(os.sep)
2123
indent = " " * 4 * (level)
2224
output += f"{indent}{os.path.basename(root)}/"

0 commit comments

Comments
 (0)