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)