Sort the results of os.walk in setup.py (#1281)
os.walk need not provide its results in any specific order. So, sorting might help with situations like that described in #1280. Even if not, it could help avoid some very mysterious bugs in the future that arise from different orders in which Hy's modules are imported.
This commit is contained in:
parent
21cec4b64a
commit
a9cfe25068
4
setup.py
4
setup.py
@ -53,8 +53,8 @@ class Install(install):
|
||||
def run(self):
|
||||
# Import each Hy module to ensure it's compiled.
|
||||
import os, importlib
|
||||
for dirpath, _, filenames in os.walk("hy"):
|
||||
for filename in filenames:
|
||||
for dirpath, _, filenames in sorted(os.walk("hy")):
|
||||
for filename in sorted(filenames):
|
||||
if filename.endswith(".hy"):
|
||||
importlib.import_module(
|
||||
dirpath.replace("/", ".") + "." + filename[:-len(".hy")])
|
||||
|
Loading…
x
Reference in New Issue
Block a user