summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHyunkyun Moon <hyunkyun.moon@linecorp.com>2023-03-02 11:10:08 (GMT)
committerGitHub <noreply@github.com>2023-03-02 11:10:08 (GMT)
commit60597439ef482a840f8ffc76eb6c27f3ba773d9c (patch)
treec289e89781ddc82999b5485bc5c723df2c6f1ddc
parenteaae563b6878aa050b4ad406b67728b6b066220e (diff)
downloadcpython-60597439ef482a840f8ffc76eb6c27f3ba773d9c.zip
cpython-60597439ef482a840f8ffc76eb6c27f3ba773d9c.tar.gz
cpython-60597439ef482a840f8ffc76eb6c27f3ba773d9c.tar.bz2
gh-95672: Update memory_watchdog to use test.support.get_pagesize (gh-102365)
-rw-r--r--Lib/test/memory_watchdog.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/Lib/test/memory_watchdog.py b/Lib/test/memory_watchdog.py
index 88cca8d..fee062e 100644
--- a/Lib/test/memory_watchdog.py
+++ b/Lib/test/memory_watchdog.py
@@ -5,20 +5,13 @@ and print it out, until terminated."""
# 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])