demandimport: support keyword arguments on _hgextimport
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 08 Aug 2015 17:07:34 -0700
changeset 25936 f90bb2002bcf
parent 25935 49dd4fd3f283
child 25937 4f1144c3c72b
demandimport: support keyword arguments on _hgextimport __import__ supports keyword arguments since Python 2.5. This proxy should too. An upcoming patch will use this feature.
mercurial/demandimport.py
--- a/mercurial/demandimport.py	Sat Aug 08 16:24:57 2015 -0700
+++ b/mercurial/demandimport.py	Sat Aug 08 17:07:34 2015 -0700
@@ -43,9 +43,9 @@
     level = 0
 _import = _origimport
 
-def _hgextimport(importfunc, name, globals, *args):
+def _hgextimport(importfunc, name, globals, *args, **kwargs):
     try:
-        return importfunc(name, globals, *args)
+        return importfunc(name, globals, *args, **kwargs)
     except ImportError:
         if not globals:
             raise
@@ -56,7 +56,7 @@
         if nameroot != contextroot:
             raise
         # retry to import with "hgext_" prefix
-        return importfunc(hgextname, globals, *args)
+        return importfunc(hgextname, globals, *args, **kwargs)
 
 class _demandmod(object):
     """module demand-loader and proxy"""