From 12c8d54748cc5865fd3592cdf17ffd54cb3962db Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 10 Nov 2009 06:49:02 +0000 Subject: Add check for python 3.0.0 or higher and exit with message. Resolve bug 2445 --- src/script/scons.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/script') 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: -- cgit v1.2.1