[issue2090] __import__ with fromlist=[''] causes double initialization of modules

Brett Cannon report at bugs.python.org
Wed Mar 19 19:04:57 CET 2008


Brett Cannon <brett at python.org> added the comment:

As you said, it's a hack, so supporting an abuse of the API is not
reasonable. You don't have to set the fromlist for the import to work.
And if you are doing it to get the tail module, you can write some
simple code to use getattr() to walk down from the root module to the
one you want.

And I plan to add a much simpler API to the imp module for people to use
directly so that these abuses don't continue.

----------
resolution:  -> invalid
status: open -> closed

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2090>
__________________________________


More information about the Python-bugs-list mailing list