Author: Antonio Cuni <anto.c...@gmail.com>
Branch: py3k
Changeset: r52981:dd83b30764ff
Date: 2012-02-28 12:39 +0100
http://bitbucket.org/pypy/pypy/changeset/dd83b30764ff/

Log:    it might happen that itertools is already imported because _io
        imports locale which imports the world. Delete it from sys.modules
        before starting the test

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
@@ -611,7 +611,7 @@
         # 'import itertools' is supposed to find itertools.py if there is
         # one in sys.path.
         import sys
-        assert 'itertools' not in sys.modules
+        sys.modules.pop('itertools', None)
         import itertools
         assert hasattr(itertools, 'hello_world')
         assert not hasattr(itertools, 'count')
@@ -624,7 +624,7 @@
         # if there is also one in sys.path as long as it is *after* the
         # special entry '.../lib_pypy/__extensions__'.
         import sys
-        assert 'itertools' not in sys.modules
+        sys.modules.pop('itertools', None)
         sys.path.append(sys.path.pop(0))
         try:
             import itertools
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to