Author: Manuel Jacob <m...@manueljacob.de>
Branch: py3k
Changeset: r82575:6dfc20f28921
Date: 2016-02-26 22:24 +0100
http://bitbucket.org/pypy/pypy/changeset/6dfc20f28921/

Log:    hg merge default

diff --git a/pypy/module/imp/test/test_import.py 
b/pypy/module/imp/test/test_import.py
--- a/pypy/module/imp/test/test_import.py
+++ b/pypy/module/imp/test/test_import.py
@@ -736,11 +736,13 @@
         # one in sys.path.
         import sys
         assert '_md5' not in sys.modules
-        import _md5
-        assert hasattr(_md5, 'hello_world')
-        assert not hasattr(_md5, 'md5')
-        assert '(built-in)' not in repr(_md5)
-        del sys.modules['_md5']
+        try:
+            import _md5
+            assert hasattr(_md5, 'hello_world')
+            assert not hasattr(_md5, 'md5')
+            assert '(built-in)' not in repr(_md5)
+        finally:
+            sys.modules.pop('_md5', None)
 
     def test_shadow_extension_2(self):
         if self.runappdirect: skip("hard to test: module is already imported")
@@ -759,7 +761,7 @@
             assert '(built-in)' in repr(_md5)
         finally:
             sys.path.insert(0, sys.path.pop())
-        del sys.modules['_md5']
+            sys.modules.pop('_md5', None)
 
     def test_invalid_pathname(self):
         import imp
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to