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.
This commit is contained in:
Victor Stinner 2011-11-14 20:50:36 +01:00
parent 0f1571ce7f
commit 16ed86831b

View file

@ -269,7 +269,8 @@ class ImportTests(unittest.TestCase):
source = TESTFN + '.py' source = TESTFN + '.py'
os.mkdir(source) os.mkdir(source)
try: try:
self.assertRaises(IOError, imp.find_module, TESTFN, ["."]) self.assertRaises((ImportError, IOError),
imp.find_module, TESTFN, ["."])
finally: finally:
os.rmdir(source) os.rmdir(source)