Unverified Kaydet (Commit) e9b185f2 authored tarafından Pablo Galindo's avatar Pablo Galindo Kaydeden (comit) GitHub

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.
üst b2385458
...@@ -1522,7 +1522,9 @@ class _PosixSpawnMixin: ...@@ -1522,7 +1522,9 @@ class _PosixSpawnMixin:
pid = self.spawn_func(no_such_executable, pid = self.spawn_func(no_such_executable,
[no_such_executable], [no_such_executable],
os.environ) 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) self.assertEqual(exc.filename, no_such_executable)
else: else:
pid2, status = os.waitpid(pid, 0) pid2, status = os.waitpid(pid, 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment