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-Tag: v2.7.3rc1~302 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=16ed86831bc44cc54abf6af634b6e9be91d8a3b3;p=thirdparty%2FPython%2Fcpython.git 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 f654c332b39a..fc3d00116e47 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)