diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2019-01-21 14:35:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-21 14:35:43 (GMT) |
commit | e9b185f2a493cc54f0d49eac44bf21e8d7de2990 (patch) | |
tree | 5757b6f90443f4f408dbb7d49873840786d45040 /Lib/test/test_posix.py | |
parent | b2385458ceddaf3d0d91456923716259d3915023 (diff) | |
download | cpython-e9b185f2a493cc54f0d49eac44bf21e8d7de2990.zip cpython-e9b185f2a493cc54f0d49eac44bf21e8d7de2990.tar.gz cpython-e9b185f2a493cc54f0d49eac44bf21e8d7de2990.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r-- | Lib/test/test_posix.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index 79fc3c2..165b837 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) |