Message242383
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 |
|
Date |
User |
Action |
Args |
2015-05-02 07:34:36 | petr.viktorin | set | recipients:
+ petr.viktorin, brett.cannon, ncoghlan, r.david.murray, docs@python, eric.snow |
2015-05-02 07:34:36 | petr.viktorin | set | messageid: <1430552076.06.0.469206723616.issue24081@psf.upfronthosting.co.za> |
2015-05-02 07:34:36 | petr.viktorin | link | issue24081 messages |
2015-05-02 07:34:35 | petr.viktorin | create | |
|