Bug 836877 - mach now errors if executed with Python 3; r=ted

DONTBUILD (NPOTB)
This commit is contained in:
Gregory Szorc 2013-02-01 10:36:28 -08:00
parent b0c8a5a4d9
commit 8462d5e3d8

6
mach
View File

@ -12,9 +12,9 @@ import sys
# Ensure we are running Python 2.7+. We put this check here so we generate a
# user-friendly error message rather than a cryptic stack trace on module
# import.
if sys.version_info[0] == 2 and sys.version_info[1] < 7:
print('Python 2.7 or above is required to run mach.')
print('You are running', platform.python_version())
if sys.version_info[0] != 2 or sys.version_info[1] < 7:
print('Python 2.7 or above (but not Python 3) is required to run mach.')
print('You are running Python', platform.python_version())
sys.exit(1)
# TODO Bug 794506 Integrate with the in-tree virtualenv configuration.