summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2009-11-10 06:49:02 +0000
committerWilliam Deegan <bill@baddogconsulting.com>2009-11-10 06:49:02 +0000
commit12c8d54748cc5865fd3592cdf17ffd54cb3962db (patch)
tree3802abf485e57dd57f7c1f3751bda160ec4df7d3 /src/script
parent14e7fa0393575e6d503e44347510648e378727da (diff)
downloadscons-12c8d54748cc5865fd3592cdf17ffd54cb3962db.tar.gz
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 94ecccb2..fb4cf525 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: