diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-28 20:55:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-28 20:55:56 +0200 |
commit | 105bef19ff3dfe0a81a68dd96cc83cc14b6b2488 (patch) | |
tree | 962635acf843694f18058e15044a611930f82422 | |
parent | 4eef88b2c1885940bdce9e107e96f9119f6fb7fb (diff) | |
parent | 17938fd54727901688d464f4f92fb8db68cc17b5 (diff) |
Merge pull request #39125 from Xrayez/py-modules-order-4.0
SCons: use `OrderedDict` to ensure insertion order of modules
-rw-r--r-- | SConstruct | 7 | ||||
-rw-r--r-- | methods.py | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/SConstruct b/SConstruct index fe94715bba..1185e9f5e1 100644 --- a/SConstruct +++ b/SConstruct @@ -8,6 +8,7 @@ import glob import os import pickle import sys +from collections import OrderedDict # Local import methods @@ -181,7 +182,7 @@ for k in platform_opts.keys(): opts.Add(o) # Detect modules. -modules_detected = {} +modules_detected = OrderedDict() module_search_paths = ["modules"] # Built-in path. if ARGUMENTS.get("custom_modules"): @@ -523,11 +524,11 @@ if selected_platform in platform_list: sys.path.remove(tmppath) sys.modules.pop("detect") - modules_enabled = {} + modules_enabled = OrderedDict() env.module_icons_paths = [] env.doc_class_path = {} - for name, path in sorted(modules_detected.items()): + for name, path in modules_detected.items(): if not env["module_" + name + "_enabled"]: continue sys.path.insert(0, path) diff --git a/methods.py b/methods.py index cb3b39ac68..c1245cd95a 100644 --- a/methods.py +++ b/methods.py @@ -2,6 +2,7 @@ import os import re import glob import subprocess +from collections import OrderedDict def add_source_files(self, sources, files, warn_duplicates=True): @@ -138,7 +139,7 @@ def parse_cg_file(fname, uniforms, sizes, conditionals): def detect_modules(at_path): - module_list = {} # name : path + module_list = OrderedDict() # name : path modules_glob = os.path.join(at_path, "*") files = glob.glob(modules_glob) |