Bug 1547730 - Use six.moves.builtins in the sandbox for configure r=glandium
authorJustin Wood <Callek@gmail.com>
Tue, 28 May 2019 14:28:36 +0000
changeset 475910 e7cfc61f2bc34adac5fab00c0f05f5eaf0e710cb
parent 475909 d89d2754488ec74c628efa4da471f8497405ce01
child 475911 690a6fec7137e383cc9495afad49964be96107a7
push id86529
push userjwood@mozilla.com
push dateTue, 28 May 2019 14:47:17 +0000
treeherderautoland@dbadda4e3c1c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1547730
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 1547730 - Use six.moves.builtins in the sandbox for configure r=glandium Differential Revision: https://phabricator.services.mozilla.com/D28113
python/mozbuild/mozbuild/configure/__init__.py
--- a/python/mozbuild/mozbuild/configure/__init__.py
+++ b/python/mozbuild/mozbuild/configure/__init__.py
@@ -908,16 +908,18 @@ class ConfigureSandbox(dict):
         if what in ('subprocess.call', 'subprocess.check_call',
                     'subprocess.check_output', 'subprocess.Popen'):
             return getattr(self._wrapped_subprocess, what[len('subprocess.'):])
         # Until this proves to be a performance problem, just construct an
         # import statement and execute it.
         import_line = ''
         if '.' in what:
             _from, what = what.rsplit('.', 1)
+            if _from == '__builtin__' or _from.startswith('__builtin__.'):
+                _from = _from.replace('__builtin__', 'six.moves.builtins')
             import_line += 'from %s ' % _from
         import_line += 'import %s as imported' % what
         glob = {}
         exec_(import_line, {}, glob)
         return glob['imported']
 
     def _resolve_and_set(self, data, name, value, when=None):
         # Don't set anything when --help was on the command line