[PATCH 2 of 2] demandimport: delay loading for "from a import b" with absolute_import

Yuya Nishihara yuya at tcha.org
Sun Jun 19 08:04:25 EDT 2016


On Sun, 19 Jun 2016 02:20:58 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> # Date 1466270253 -32400
> #      Sun Jun 19 02:17:33 2016 +0900
> # Node ID 97bcb2d76d079903e95219fc40bb89d25b33079d
> # Parent  04da1198949bcd8c1d1fd6675816eacfdc2f3dcf
> demandimport: delay loading for "from a import b" with absolute_import

> At 4f1144c3c72b introducing original "work around" for "from a import
> b" case, elements in "fromlist" were imported with "level=level". But
> "level" might be grater than 1 (e.g. level=2 in "from .. import b"
> case) at demandimport() invocation, and importing direct sub-module in
> "fromlist" with level grater than 1 causes unexpected result.
> 
> IMHO, this seems main reason of "errors for unknown reason" described
> in 4f1144c3c72b, and we don't have to worry about it, because this
> issue was already fixed by 78d05778907b.

The code change and this explanation seem correct. Queued, thanks.


More information about the Mercurial-devel mailing list