Message168129
So imp.load_dynamic() does add a module to sys.modules (I'm using Python 3.2 here because that's what I have access to, but I verified this yesterday at home)::
Python 3.2.3 (default, May 3 2012, 15:51:42)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import imp
>>> import sys
>>> 'resource' in sys.modules
False
>>> mod = imp.load_dynamic('resource', '/usr/lib/python3.2/lib-dynload/resource.cpython-32mu.so')
>>> mod
<module 'resource' from '/usr/lib/python3.2/lib-dynload/resource.cpython-32mu.so'>
>>> 'resource' in sys.modules
True
IOW it is not needed for ExtensionFileLoader to add the module explicitly to sys.modules.
As for Meador's notice that __init__.py was being imported, I believe Stefan is saying it should work without that file. So deleting __init__.py and only having __init__.so in Python 3.2 should work. If not then this has been a false alarm. |
|
Date |
User |
Action |
Args |
2012-08-13 17:18:42 | brett.cannon | set | recipients:
+ brett.cannon, georg.brandl, scoder, Arfrever, meador.inge, eric.snow |
2012-08-13 17:18:42 | brett.cannon | set | messageid: <1344878322.5.0.462547572529.issue15623@psf.upfronthosting.co.za> |
2012-08-13 17:18:41 | brett.cannon | link | issue15623 messages |
2012-08-13 17:18:41 | brett.cannon | create | |
|