summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-11-14 19:50:36 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-11-14 19:50:36 (GMT)
commit16ed86831bc44cc54abf6af634b6e9be91d8a3b3 (patch)
treeea6f1e1421b42b9e5df161455e5de28277081d5c
parent0f1571ce7fb7da0e2ad75f941b29f2d19717e012 (diff)
downloadcpython-16ed86831bc44cc54abf6af634b6e9be91d8a3b3.zip
cpython-16ed86831bc44cc54abf6af634b6e9be91d8a3b3.tar.gz
cpython-16ed86831bc44cc54abf6af634b6e9be91d8a3b3.tar.bz2
Issue #7732: Try to fix the a failing test on Windows
It doesn't matter if imp.find_module() fails with ImportError or IOError, but it should not crash.
-rw-r--r--Lib/test/test_import.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index f654c33..fc3d001 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -269,7 +269,8 @@ class ImportTests(unittest.TestCase):
source = TESTFN + '.py'
os.mkdir(source)
try:
- self.assertRaises(IOError, imp.find_module, TESTFN, ["."])
+ self.assertRaises((ImportError, IOError),
+ imp.find_module, TESTFN, ["."])
finally:
os.rmdir(source)