GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-150114: Fix get_process_memory_usage() on Windows (#150399) · python/cpython@a189e3d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Lib/test/libregrtest
    • utils.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Lib/test/libregrtest/utils.py‎

Copy file name to clipboardExpand all lines: Lib/test/libregrtest/utils.py
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,8 +788,11 @@ def _get_process_memory_usage_linux(pid: int) -> int | None:
788788

789789
def _get_process_memory_usage_windows(pid: int) -> int | None:
790790
assert _winapi is not None # to make mypy happy
791-
handle = _winapi.OpenProcess(_winapi.PROCESS_QUERY_LIMITED_INFORMATION,
792-
False, pid)
791+
try:
792+
handle = _winapi.OpenProcess(_winapi.PROCESS_QUERY_LIMITED_INFORMATION,
793+
False, pid)
794+
except OSError:
795+
return None
793796
try:
794797
mem_info = _winapi.GetProcessMemoryInfo(handle)
795798
finally:

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.