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:
parent
f69055efba
commit
bd54f0eb3a
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue