This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brett.cannon
Recipients Arfrever, brett.cannon, eric.snow, georg.brandl, meador.inge, scoder
Date 2012-08-13.17:18:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1344878322.5.0.462547572529.issue15623@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-08-13 17:18:42brett.cannonsetrecipients: + brett.cannon, georg.brandl, scoder, Arfrever, meador.inge, eric.snow
2012-08-13 17:18:42brett.cannonsetmessageid: <1344878322.5.0.462547572529.issue15623@psf.upfronthosting.co.za>
2012-08-13 17:18:41brett.cannonlinkissue15623 messages
2012-08-13 17:18:41brett.cannoncreate