From 16ed86831bc44cc54abf6af634b6e9be91d8a3b3 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 14 Nov 2011 20:50:36 +0100 Subject: [PATCH] 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. --- Lib/test/test_import.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index f654c332b39..fc3d00116e4 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)