Bug 1689467 - Allow mach commands in test package to use python 3. r=releng-reviewers,jmaher

Few mach commands require python 2 nowadays. It doesn't make sense to
error out anymore.

Differential Revision: https://phabricator.services.mozilla.com/D103448
This commit is contained in:
Mike Hommey 2021-01-29 12:08:46 +00:00
parent beb8f44609
commit c1515076ae

View File

@ -6,7 +6,6 @@ from __future__ import absolute_import, print_function, unicode_literals
import json
import os
import platform
import sys
import types
@ -182,14 +181,6 @@ def normalize_test_path(test_root, path):
def bootstrap(test_package_root):
test_package_root = os.path.abspath(test_package_root)
# 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 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)
sys.path[0:0] = [os.path.join(test_package_root, path) for path in SEARCH_PATHS]
import mach.main