Safer sys.modules delete
This commit is contained in:
parent
427bf42a52
commit
58ce3a9e8c
|
@ -215,7 +215,8 @@ class AssertionRewritingHook(object):
|
||||||
mod.__loader__ = self
|
mod.__loader__ = self
|
||||||
py.builtin.exec_(co, mod.__dict__)
|
py.builtin.exec_(co, mod.__dict__)
|
||||||
except:
|
except:
|
||||||
del sys.modules[name]
|
if name in sys.modules:
|
||||||
|
del sys.modules[name]
|
||||||
raise
|
raise
|
||||||
return sys.modules[name]
|
return sys.modules[name]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue