Message168118
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. |
|
Date |
User |
Action |
Args |
2012-08-13 15:29:16 | eric.snow | set | recipients:
+ eric.snow, brett.cannon, georg.brandl, scoder, Arfrever, meador.inge |
2012-08-13 15:29:16 | eric.snow | set | messageid: <1344871756.03.0.383666125159.issue15623@psf.upfronthosting.co.za> |
2012-08-13 15:29:15 | eric.snow | link | issue15623 messages |
2012-08-13 15:29:15 | eric.snow | create | |
|