From: Pablo Galindo Date: Mon, 21 Jan 2019 14:35:43 +0000 (+0000) Subject: bpo-35794: Catch PermissionError in test_no_such_executable (GH-11635) X-Git-Tag: v3.8.0a1~65 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e9b185f2a493cc54f0d49eac44bf21e8d7de2990;p=thirdparty%2FPython%2Fcpython.git bpo-35794: Catch PermissionError in test_no_such_executable (GH-11635) PermissionError can be raised if there are directories in the $PATH that are not accessible when using posix_spawnp. --- diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 79fc3c264418..165b83713408 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -1522,7 +1522,9 @@ class _PosixSpawnMixin: pid = self.spawn_func(no_such_executable, [no_such_executable], os.environ) - except FileNotFoundError as exc: + # bpo-35794: PermissionError can be raised if there are + # directories in the $PATH that are not accessible. + except (FileNotFoundError, PermissionError) as exc: self.assertEqual(exc.filename, no_such_executable) else: pid2, status = os.waitpid(pid, 0)