From patchwork Wed Dec 23 06:24:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4,of,8] demandimport: pass fromlist to original import function From: Bryan O'Sullivan X-Patchwork-Id: 12268 Message-Id: <030387dc5db0113c41a0.1450851882@bryano-mbp.local> To: mercurial-devel@selenic.com Date: Tue, 22 Dec 2015 22:24:42 -0800 # HG changeset patch # User Bryan O'Sullivan # Date 1450849086 28800 # Tue Dec 22 21:38:06 2015 -0800 # Node ID 030387dc5db0113c41a0b3b4ba72a118aa2bc84b # Parent 84a069c3cf4bfcc56cd889a7c03ef974d3913b98 demandimport: pass fromlist to original import function Without this, nested imports of the variety "from . import wibble" break. But that bug is in turn hidden by the "if" clause immediately before, which we will excise in the next commit. diff --git a/mercurial/demandimport.py b/mercurial/demandimport.py --- a/mercurial/demandimport.py +++ b/mercurial/demandimport.py @@ -191,7 +191,8 @@ def _demandimport(name, globals=None, lo return _hgextimport(_origimport, name, globals, locals, fromlist, level) - mod = _hgextimport(_origimport, name, globals, locals, level=level) + mod = _hgextimport(_origimport, name, globals, locals, fromlist, + level) for x in fromlist: processfromitem(mod, x)