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 r.david.murray
Recipients Calvin.Spealman, eric.snow, r.david.murray
Date 2011-07-13.23:13:52
SpamBayes Score 1.0022723e-05
Marked as misclassified No
Message-id <1310598833.46.0.358697480705.issue12554@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, that's exactly my point.  The loading of a module into sys.modules is a separate issue from the creation of a pointer to that module in the local name space.  Once the former succeeds, it has succeeded and won't be done again.  When the module that did the import fails to complete, *it* is cleaned up, which cleans up the pointer in the local name space, but that doesn't (by design) affect sys.modules.

It's not all that dissimilar to what would happen if you had top-level code in your module that opened and wrote to a file.  If an exception later in the module code causes it to fail to load, the file it created would not be deleted.
History
Date User Action Args
2011-07-13 23:13:53r.david.murraysetrecipients: + r.david.murray, Calvin.Spealman, eric.snow
2011-07-13 23:13:53r.david.murraysetmessageid: <1310598833.46.0.358697480705.issue12554@psf.upfronthosting.co.za>
2011-07-13 23:13:52r.david.murraylinkissue12554 messages
2011-07-13 23:13:52r.david.murraycreate