Skip to content

Commit

Permalink
Sort glob output
Browse files Browse the repository at this point in the history
Similar to C, bash, perl, ruby, make

See https://reproducible-builds.org/ for why this is good.

This patch was done while working on reproducible builds for openSUSE.
  • Loading branch information
bmwiedemann committed Jan 29, 2024
1 parent 6ee1de0 commit b668c95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/glob.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def glob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
If `recursive` is true, the pattern '**' will match any files and
zero or more directories and subdirectories.
"""
return list(iglob(pathname, root_dir=root_dir, dir_fd=dir_fd, recursive=recursive,
return sorted(iglob(pathname, root_dir=root_dir, dir_fd=dir_fd, recursive=recursive,
include_hidden=include_hidden))

def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
Expand Down

0 comments on commit b668c95

Please sign in to comment.