From: Victor Stinner Date: Wed, 31 Oct 2012 00:12:55 +0000 (+0100) Subject: Issue #15478: Fix test_os on FreeBSD X-Git-Tag: v3.4.0a1~2134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bd54f0eb3aaef0ebf53cdc98bb16979e0add7b08;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 0d1f60a4f361..a4cf60fed4ba 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -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))