diff options
author | William Deegan <bill@baddogconsulting.com> | 2009-11-10 06:49:02 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2009-11-10 06:49:02 (GMT) |
commit | 3ee7452fdb9532f96f7d438065619f5a4f3abe31 (patch) | |
tree | 3802abf485e57dd57f7c1f3751bda160ec4df7d3 | |
parent | da25e7ac7d6fdea70c388cd25dc3ee750d18b2e3 (diff) | |
download | SCons-3ee7452fdb9532f96f7d438065619f5a4f3abe31.zip SCons-3ee7452fdb9532f96f7d438065619f5a4f3abe31.tar.gz SCons-3ee7452fdb9532f96f7d438065619f5a4f3abe31.tar.bz2 |
Add check for python 3.0.0 or higher and exit with message.
Resolve bug 2445
-rw-r--r-- | src/CHANGES.txt | 3 | ||||
-rw-r--r-- | src/RELEASE.txt | 2 | ||||
-rw-r--r-- | src/script/scons.py | 13 |
3 files changed, 17 insertions, 1 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 0039c32..6c16a4a 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -25,6 +25,9 @@ RELEASE X.X.X - XXX Compilers. This will be rolled out to other platforms/tools in the future. + - Add check for python >= 3.0.0 and exit gracefully. + For 1.3 python >= 1.5.2 and < 3.0.0 are supported + From Lukas Erlinghagen: - Have AddOption() remove variables from the list of diff --git a/src/RELEASE.txt b/src/RELEASE.txt index 5691dd7..8050c03 100644 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -34,7 +34,7 @@ RELEASE 1.2.0.d20090223 - Mon, 23 Feb 2009 08:41:06 -0800 features will still be supported in 1.3.0 but will generate mandatory, non-disableable warnings: - -- Support for Python versions 1.5, 1.6, 2.0 and 2.1. + -- Support for Python versions 1.5, 1.6, 2.0, 2.1, 2.2 and 2.3. -- The overrides= keyword argument to the Builder() call. -- The scanner= keyword argument to the Builder() call. -- The BuildDir() function and env.BuildDir() method. diff --git a/src/script/scons.py b/src/script/scons.py index 94ecccb..fb4cf52 100644 --- a/src/script/scons.py +++ b/src/script/scons.py @@ -56,6 +56,19 @@ import sys # followed by generic) so we pick up the right version of the build # 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" + 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 + script_dir = sys.path[0] if script_dir in sys.path: |