Bug 1256571 - Allow ConfigureSandbox.run to not include a given file. r?chmanchester draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 13 Apr 2016 08:57:45 +0900
changeset 350231 b30bf73443fb2b957846852a7c96ef1d6509a7b6
parent 350230 7857fbf1475a86db634486a33914218b98946114
child 350232 821a498713ec4292af22b3b5402782b3d5b7d892
push id15274
push userbmo:mh+mozilla@glandium.org
push dateWed, 13 Apr 2016 01:01:28 +0000
reviewerschmanchester
bugs1256571
milestone48.0a1
Bug 1256571 - Allow ConfigureSandbox.run to not include a given file. r?chmanchester
python/mozbuild/mozbuild/configure/__init__.py
--- a/python/mozbuild/mozbuild/configure/__init__.py
+++ b/python/mozbuild/mozbuild/configure/__init__.py
@@ -191,20 +191,21 @@ class ConfigureSandbox(dict):
         source = open(path, 'rb').read()
 
         code = compile(source, path, 'exec')
 
         exec(code, self)
 
         self._paths.pop(-1)
 
-    def run(self, path):
+    def run(self, path=None):
         '''Executes the given file within the sandbox, and ensure the overall
         consistency of the executed script.'''
-        self.include_file(path)
+        if path:
+            self.include_file(path)
 
         for option in self._options.itervalues():
             # All options must be referenced by some @depends function
             if option not in self._seen:
                 raise ConfigureError(
                     'Option `%s` is not handled ; reference it with a @depends'
                     % option.option
                 )