[issue15623] Init time relative imports no longer work from __init__.so modules

Brett Cannon report at bugs.python.org
Tue Aug 14 18:29:57 CEST 2012


Brett Cannon added the comment:

I had a minute free so I just tried inserting an empty module into sys.modules and then importing an extension module to see if it would get reused. It doesn't. imp.load_dynamic() actually just blindly overwrites what is in sys.modules. I'm willing to bet it just assumes whatever is in the special extensions module cache is the canonical module and just re-inserts blindly into sys.modules.

So that leaves needing to diagnose where Python 3.3 inserts an extension into sys.modules and if it can somehow be moved up. Probably should also see how the heck 3.2 is doing it to know where the difference occurs to make sure that it isn't some silly oversight somehow.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15623>
_______________________________________


More information about the Python-bugs-list mailing list