[issue579] demandimport: "from foo import submodule" doesn't update submodule variable after loading

Alexis S. L. Carvalho mercurial-bugs at selenic.com
Mon Jun 4 17:58:02 CDT 2007


New submission from Alexis S. L. Carvalho <alexis at cecm.usp.br>:

I was looking at some extensions and noticed that the _load function in
demandimport.py was being called a lot.

It turns out that after something like "from mercurial import util", accessing
something like util.tolocal works just fine, but the "util" name is not updated
to point to the just loaded module. As a result, the next time we access
something in util, we'll have to go through the demandimport mechanism again
(which will work fine, but is unnecessary work).

There's a test case attached.

----------
files: demandimport-bug.py
messages: 3156
nosy: alexis
priority: bug
status: unread
title: demandimport: "from foo import submodule" doesn't update submodule variable after loading
topic: performance

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue579>
____________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: demandimport-bug.py
Type: text/x-python
Size: 413 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20070604/b81a74eb/attachment.py 


More information about the Mercurial-devel mailing list