Issue #15478: Fix test_os on FreeBSD

Calling OS functions can fail with errors other than FileNotFoundError: a
FreeBSD buildbot fails for example with a PermissionError.
This commit is contained in:
Victor Stinner 2012-10-31 01:12:55 +01:00
parent f69055efba
commit bd54f0eb3a
1 changed files with 1 additions and 1 deletions

View File

@ -2112,7 +2112,7 @@ class OSErrorTests(unittest.TestCase):
for name in self.filenames:
try:
func(name, *func_args)
except FileNotFoundError as err:
except OSError as err:
self.assertIs(err.filename, name)
else:
self.fail("No exception thrown by {}".format(func))