Mercurial > hg-stable
changeset 25936:f90bb2002bcf
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.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 08 Aug 2015 17:07:34 -0700 |
parents | 49dd4fd3f283 |
children | 4f1144c3c72b |
files | mercurial/demandimport.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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"""