]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #15478: Fix test_os on FreeBSD
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 31 Oct 2012 00:12:55 +0000 (01:12 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 31 Oct 2012 00:12:55 +0000 (01:12 +0100)
Calling OS functions can fail with errors other than FileNotFoundError: a
FreeBSD buildbot fails for example with a PermissionError.

Lib/test/test_os.py

index 0d1f60a4f361bc68ac62e87cbd69d4c9707af4da..a4cf60fed4ba04d97df80edb64d923ae2f0ce5d0 100644 (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))