demandimport: fix an obscure corner-case.
authorDan Villiom Podlaski Christiansen <danchr@gmail.com>
Tue, 14 Sep 2010 23:00:39 +0200
changeset 12686 fe31f834a9ff
parent 12685 a247751652ba
child 12687 34d8247a4595
demandimport: fix an obscure corner-case. Python's __import__() function has 'level' as the fourth argument, not the third. The code path in question probably never worked. (This was seen trying to run Mercurial in PyPy. Fixing this made it die somewhere else...)
mercurial/demandimport.py
--- a/mercurial/demandimport.py	Sun Oct 10 00:38:57 2010 +0100
+++ b/mercurial/demandimport.py	Tue Sep 14 23:00:39 2010 +0200
@@ -45,7 +45,7 @@
         if not self._module:
             head, globals, locals, after, level = self._data
             if level is not None:
-                mod = _origimport(head, globals, locals, level)
+                mod = _origimport(head, globals, locals, level=level)
             else:
                 mod = _origimport(head, globals, locals)
             # load submodules