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
1 changed files with 2 additions and 1 deletions

View File

@ -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)