You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MSVS: revise the vcxproj embedded python script contents to be backward compatible with current master
Changes:
* Determine the SCons module path in the same manner as the current master code.
* Adjust the SCons module path using the generated path location under certain conditions.
from os.path import abspath, dirname, isdir, isfile, join, realpath
197
+
from os.path import abspath, dirname, join, normcase, realpath
198
+
from pathlib import Path
204
199
usr_path = r'{scons_home}'
205
200
gen_path = r'{scons_abspath}'
206
-
syspath = sys.path
207
-
search, path = ([usr_path], usr_path) if usr_path else ([gen_path], gen_path) if gen_path else ([join(sys.prefix, *t) for t in [('Lib', 'site-packages', 'scons-{scons_version}'), ('scons-{scons_version}',), ('Lib', 'site-packages', 'scons'), ('scons',), ('Lib', 'site-packages')]] + sys.path, None)
208
-
sys.path = search
209
-
spec = importlib.util.find_spec('SCons')
210
-
orig = dirname(dirname(abspath(spec.origin))) if (spec and spec.origin) else ''
211
-
sys.path = [orig] + syspath if orig else syspath
212
-
_ = print(f'proj: Using SCons path \\\'{{orig}}\\\' (realpath=\\\'{{realpath(orig)}}\\\').') if orig else (print(f'proj: Error: SCons not found (path=\\\'{{path if path else search}}\\\').'), sys.exit(1))
from os.path import abspath, dirname, isdir, isfile, join, realpath
871
+
from os.path import abspath, dirname, join, normcase, realpath
872
+
from pathlib import Path
878
873
usr_path = r'{scons_home}'
879
874
gen_path = r'{scons_abspath}'
880
-
syspath = sys.path
881
-
search, path = ([usr_path], usr_path) if usr_path else ([gen_path], gen_path) if gen_path else ([join(sys.prefix, *t) for t in [('Lib', 'site-packages', 'scons-{scons_version}'), ('scons-{scons_version}',), ('Lib', 'site-packages', 'scons'), ('scons',), ('Lib', 'site-packages')]] + sys.path, None)
882
-
sys.path = search
883
-
spec = importlib.util.find_spec('SCons')
884
-
orig = dirname(dirname(abspath(spec.origin))) if (spec and spec.origin) else ''
885
-
sys.path = [orig] + syspath if orig else syspath
886
-
_ = print(f'proj: Using SCons path \\\'{{orig}}\\\' (realpath=\\\'{{realpath(orig)}}\\\').') if orig else (print(f'proj: Error: SCons not found (path=\\\'{{path if path else search}}\\\').'), sys.exit(1))
0 commit comments