From: Victor Stinner Date: Mon, 14 Nov 2011 19:50:36 +0000 (+0100) Subject: Issue #7732: Try to fix the a failing test on Windows X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=16ed86831bc44cc54abf6af634b6e9be91d8a3b3;p=python 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. --- diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py index f654c332b3..fc3d00116e 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)