Bug 836877 - mach now errors if executed with Python 3; r=ted
authorGregory Szorc <gps@mozilla.com>
Fri, 01 Feb 2013 10:36:28 -0800
changeset 120479 95bec0e5a600654c34f4b9f280e4293c71055885
parent 120478 a4f8cb70cc5d1949fdcf2b1347c4bd43494a06bd
child 120480 b546bd987ed4007bcf9006b21f3234157ce7d71a
push id24254
push usergszorc@mozilla.com
push dateFri, 01 Feb 2013 18:37:04 +0000
treeherdermozilla-central@95bec0e5a600 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs836877
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 836877 - mach now errors if executed with Python 3; r=ted DONTBUILD (NPOTB)
mach
--- a/mach
+++ b/mach
@@ -7,19 +7,19 @@ from __future__ import print_function, u
 
 import os
 import platform
 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.
 SEARCH_PATHS = [
     'python/mach',
     'python/mozboot',
     'python/mozbuild',
     'build',