summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_posix.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r--Lib/test/test_posix.py4
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)