Skip to content

Commit

Permalink
gh-95672: Update memory_watchdog to use test.support.get_pagesize (gh…
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeongyun0916 authored Mar 2, 2023
1 parent eaae563 commit 6059743
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Lib/test/memory_watchdog.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,13 @@
# If the process crashes, reading from the /proc entry will fail with ESRCH.


import os
import sys
import time
from test.support import get_pagesize


try:
page_size = os.sysconf('SC_PAGESIZE')
except (ValueError, AttributeError):
try:
page_size = os.sysconf('SC_PAGE_SIZE')
except (ValueError, AttributeError):
page_size = 4096

while True:
page_size = get_pagesize()
sys.stdin.seek(0)
statm = sys.stdin.read()
data = int(statm.split()[5])
Expand Down

0 comments on commit 6059743

Please sign in to comment.