Bug 1550956: Import builtins in Python 3 compatible way r=firefox-build-system-reviewers,chmanchester
☠☠ backed out by 5f95b3f2ea44 ☠ ☠
authorKagami Sascha Rosylight <saschanaz@outlook.com>
Tue, 21 May 2019 18:38:46 +0000
changeset 474871 fa4c37c31dfd7b4de6ff271222bc6e9561c66609
parent 474870 26d8d5e2e3c48e2c3488c381a32ee66d827ae213
child 474872 267ddc3595fe2147c72e97e97cdd25f3a7519fa9
push id36047
push usernerli@mozilla.com
push dateWed, 22 May 2019 03:40:58 +0000
treeherdermozilla-central@267ddc3595fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfirefox-build-system-reviewers, chmanchester
bugs1550956
milestone69.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 1550956: Import builtins in Python 3 compatible way r=firefox-build-system-reviewers,chmanchester Differential Revision: https://phabricator.services.mozilla.com/D30790
build/mach_bootstrap.py
--- a/build/mach_bootstrap.py
+++ b/build/mach_bootstrap.py
@@ -6,17 +6,20 @@ from __future__ import print_function, u
 
 import errno
 import json
 import os
 import platform
 import subprocess
 import sys
 import uuid
-import __builtin__
+try:
+    import builtins
+except ImportError:
+    import __builtin__ as builtins
 
 from types import ModuleType
 
 
 STATE_DIR_FIRST_RUN = '''
 mach and the build system store shared state in a common directory on the
 filesystem. The following directory will be created:
 
@@ -429,9 +432,9 @@ class ImportHook(object):
                 os.remove(module.__file__)
             del sys.modules[module.__name__]
             module = self(name, globals, locals, fromlist, level)
 
         return module
 
 
 # Install our hook
-__builtin__.__import__ = ImportHook(__builtin__.__import__)
+builtins.__import__ = ImportHook(builtins.__import__)