]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-116195: Implements a fast path for nt.getppid (GH-116205)
authorvxiiduu <73044267+vxiiduu@users.noreply.github.com>
Thu, 14 Mar 2024 23:09:36 +0000 (09:09 +1000)
committerGitHub <noreply@github.com>
Thu, 14 Mar 2024 23:09:36 +0000 (23:09 +0000)
commitbe1c808fcad201adc4d5d6cca52ddb24aeb5e367
treeba92f317bedc3757a53f8ae2ad19b1225b93ac28
parent7bbb9b57e67057d5ca3b7e3a434527fb3fcf5a2b
gh-116195: Implements a fast path for nt.getppid (GH-116205)

Use the NtQueryInformationProcess system call to efficiently retrieve the parent process ID in a single step, rather than using the process snapshots API which retrieves large amounts of unnecessary information and is more prone to failure (since it makes heap allocations).

Includes a fallback to the original win32_getppid implementation in case the unstable API appears to return strange results.
Misc/NEWS.d/next/Windows/2024-03-14-20-46-23.gh-issue-116195.Cu_rYs.rst [new file with mode: 0644]
Modules/posixmodule.c