summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2009-11-10 06:49:02 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2009-11-10 06:49:02 (GMT)
commit3ee7452fdb9532f96f7d438065619f5a4f3abe31 (patch)
tree3802abf485e57dd57f7c1f3751bda160ec4df7d3 /src/script
parentda25e7ac7d6fdea70c388cd25dc3ee750d18b2e3 (diff)
downloadSCons-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
Diffstat (limited to 'src/script')
-rw-r--r--src/script/scons.py13
1 files changed, 13 insertions, 0 deletions
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: