Brett Cannon added the comment:

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.

----------

_______________________________________
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