Eric Snow added the comment:

That's helpful, Meador.  With regards to the following, there's more to the 
story:

> With 3.3 a _frozen_importlib.ExtensionFileLoader loader gets created
> against 'my_test_package/__init__.so'.  This doesn't work because
> ExtensionFileLoader does *not* fixup sys.module when it loads.

In the example Stefan provided, look at my_test_package/__init__.c:921.  You'll 
find PyInit_my_test_package().  The module creation code from msg168026 comes 
from that function.  There PyImport_AddModule gets called, which adds the 
module to interp->modules.  I haven't had time to run this through gdb to see 
what's happening sys.modules in this case.

In general, I'm not familiar enough with extension modules to know if they are 
actually responsible for adding themselves to sys.modules.  I do see a number 
of places in Python/import.c and friends that touch sys.modules.

If importlib is in charge of adding it, though, I'd think that 
ExtensionFileLoader.load_module would need the module_for_loader decorator.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15623>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to