Bug 836877 - mach now errors if executed with Python 3; r=ted
DONTBUILD (NPOTB)
--- 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',