mirror of
https://github.com/python/cpython
synced 2026-09-29 10:15:30 +03:00
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.
This commit is contained in:
parent
b2385458ce
commit
e9b185f2a4
1 changed files with 3 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue