Bug 1513134 - Make ConfigureSandbox._apply_imports clear _imports itself. r=firefox-build-system-reviewers,gps
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 11 Dec 2018 19:33:17 +0000
changeset 507215 968eef77fcd10672402a785cf886e1dd34e4a4a9
parent 507214 bb88762f03194cd494e9914285d40a64df41c861
child 507216 bcbedb8171376816a4b4ee399d4bffe197e42aae
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfirefox-build-system-reviewers, gps
bugs1513134
milestone66.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 1513134 - Make ConfigureSandbox._apply_imports clear _imports itself. r=firefox-build-system-reviewers,gps This is a not strictly necessary drive-by cleanup. Differential Revision: https://phabricator.services.mozilla.com/D14124
python/mozbuild/mozbuild/configure/__init__.py
--- a/python/mozbuild/mozbuild/configure/__init__.py
+++ b/python/mozbuild/mozbuild/configure/__init__.py
@@ -817,17 +817,17 @@ class ConfigureSandbox(dict):
             # them later.
             imports = self._imports.setdefault(func, [])
             imports.insert(0, (_from, _import, _as))
             return func
 
         return decorator
 
     def _apply_imports(self, func, glob):
-        for _from, _import, _as in self._imports.get(func, ()):
+        for _from, _import, _as in self._imports.pop(func, ()):
             _from = '%s.' % _from if _from else ''
             if _as:
                 glob[_as] = self._get_one_import('%s%s' % (_from, _import))
             else:
                 what = _import.split('.')[0]
                 glob[what] = self._get_one_import('%s%s' % (_from, what))
 
     def _get_one_import(self, what):
@@ -1025,13 +1025,12 @@ class ConfigureSandbox(dict):
             func.__name__,
             func.func_defaults,
             closure
         ))
         @self.wraps(new_func)
         def wrapped(*args, **kwargs):
             if func in self._imports:
                 self._apply_imports(func, glob)
-                del self._imports[func]
             return new_func(*args, **kwargs)
 
         self._prepared_functions.add(wrapped)
         return wrapped, glob