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 petr.viktorin
Recipients brett.cannon, docs@python, eric.snow, ncoghlan, petr.viktorin, r.david.murray
Date 2015-05-02.07:34:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1430552076.06.0.469206723616.issue24081@psf.upfronthosting.co.za>
In-reply-to
Content
Not true (on 3.3 & 2.7).

>>> import sys
>>> import x
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/x.py", line 1, in <module>
    import y
  File "/tmp/y.py", line 1, in <module>
    1/0
ZeroDivisionError: division by zero
>>> sys.modules['x']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'x'
>>> sys.modules['y']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'y'

For 3.4, PEP 451 explicitly specifies ``del sys.modules[spec.name]`` if ``loader.exec_module`` fails [0].

[0] https://www.python.org/dev/peps/pep-0451/#how-loading-will-work
History
Date User Action Args
2015-05-02 07:34:36petr.viktorinsetrecipients: + petr.viktorin, brett.cannon, ncoghlan, r.david.murray, docs@python, eric.snow
2015-05-02 07:34:36petr.viktorinsetmessageid: <1430552076.06.0.469206723616.issue24081@psf.upfronthosting.co.za>
2015-05-02 07:34:36petr.viktorinlinkissue24081 messages
2015-05-02 07:34:35petr.viktorincreate