diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 83682628ba680c..2ef5c24fc0e6a8 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -416,7 +416,7 @@ def byte_compile (py_files, else: from py_compile import compile - for file in py_files: + for file in sorted(py_files): if file[-3:] != ".py": # This lets us be lazy and not filter filenames in # the "install_lib" command. diff --git a/Misc/NEWS.d/next/Library/2018-07-03-09-40-44.bpo-29708.vs6fdO.rst b/Misc/NEWS.d/next/Library/2018-07-03-09-40-44.bpo-29708.vs6fdO.rst new file mode 100644 index 00000000000000..3c1701787f39d5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2018-07-03-09-40-44.bpo-29708.vs6fdO.rst @@ -0,0 +1,2 @@ +distutils: To get reproducible builds, byte_compile() of distutils.util now +sorts filenames. Patch from OpenSUSE by Bernhard M. Wiedemann.