R. David Murray <rdmur...@bitdance.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12554>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to