We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dfe7ef6 commit a189e3dCopy full SHA for a189e3d
1 file changed
Lib/test/libregrtest/utils.py
@@ -788,8 +788,11 @@ def _get_process_memory_usage_linux(pid: int) -> int | None:
788
789
def _get_process_memory_usage_windows(pid: int) -> int | None:
790
assert _winapi is not None # to make mypy happy
791
- handle = _winapi.OpenProcess(_winapi.PROCESS_QUERY_LIMITED_INFORMATION,
792
- False, pid)
+ try:
+ handle = _winapi.OpenProcess(_winapi.PROCESS_QUERY_LIMITED_INFORMATION,
793
+ False, pid)
794
+ except OSError:
795
+ return None
796
try:
797
mem_info = _winapi.GetProcessMemoryInfo(handle)
798
finally:
0 commit comments