diff options
| author | Robert Managan <ramanagan@att.net> | 2012-12-15 06:00:17 (GMT) |
|---|---|---|
| committer | Robert Managan <ramanagan@att.net> | 2012-12-15 06:00:17 (GMT) |
| commit | a27fa15ddc3af3e1ee3dfe2488fa499ba906dfda (patch) | |
| tree | 737dc474ead899b9157657453364730679816a47 /src/script | |
| parent | 3cf978d7964fb474f8a6219f48008f07913aabec (diff) | |
| parent | 1bf9aa83fc024950012dd76d110443fc2d30c92a (diff) | |
| download | SCons-a27fa15ddc3af3e1ee3dfe2488fa499ba906dfda.zip SCons-a27fa15ddc3af3e1ee3dfe2488fa499ba906dfda.tar.gz SCons-a27fa15ddc3af3e1ee3dfe2488fa499ba906dfda.tar.bz2 | |
merge in changes from SCons default
Diffstat (limited to 'src/script')
| -rw-r--r-- | src/script/scons.py | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/script/scons.py b/src/script/scons.py index 86d2562..46e6d2b 100644 --- a/src/script/scons.py +++ b/src/script/scons.py @@ -55,18 +55,12 @@ import sys # engine modules if they're in either directory. -# Check to see if the python version is > 3.0 which is currently unsupported -# If so exit with error message -try: - if sys.version_info >= (3,0,0): - msg = "scons: *** SCons version %s does not run under Python version %s.\n\ -Python 3.0 and later are not yet supported.\n" - sys.stderr.write(msg % (__version__, sys.version.split()[0])) - sys.exit(1) -except AttributeError: - # Pre-1.6 Python has no sys.version_info - # No need to check version as we then know the version is < 3.0.0 and supported - pass +if sys.version_info >= (3,0,0): + msg = "scons: *** SCons version %s does not run under Python version %s.\n\ +Python 3 is not yet supported.\n" + sys.stderr.write(msg % (__version__, sys.version.split()[0])) + sys.exit(1) + script_dir = sys.path[0] @@ -184,7 +178,15 @@ sys.path = libs + sys.path ############################################################################## if __name__ == "__main__": - import SCons.Script + try: + import SCons.Script + except: + ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'engine') + if os.path.exists(ROOT): + sys.path += [ROOT] + print("SCons import failed. Trying to run from source directory") + import SCons.Script + # this does all the work, and calls sys.exit # with the proper exit status when done. SCons.Script.main() |
