aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/pythoninfo.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/pythoninfo.py')
-rw-r--r--Lib/test/pythoninfo.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
index c6288334780..b25def78e42 100644
--- a/Lib/test/pythoninfo.py
+++ b/Lib/test/pythoninfo.py
@@ -666,12 +666,34 @@ def collect_decimal(info_add):
def collect_testcapi(info_add):
try:
+ import _testcapi
+ except ImportError:
+ return
+
+ for name in (
+ 'LONG_MAX', # always 32-bit on Windows, 64-bit on 64-bit Unix
+ 'PY_SSIZE_T_MAX',
+ 'Py_C_RECURSION_LIMIT',
+ 'SIZEOF_TIME_T', # 32-bit or 64-bit depending on the platform
+ 'SIZEOF_WCHAR_T', # 16-bit or 32-bit depending on the platform
+ ):
+ copy_attr(info_add, f'_testcapi.{name}', _testcapi, name)
+
+
+def collect_testinternalcapi(info_add):
+ try:
import _testinternalcapi
except ImportError:
return
call_func(info_add, 'pymem.allocator', _testinternalcapi, 'pymem_getallocatorsname')
+ for name in (
+ 'SIZEOF_PYGC_HEAD',
+ 'SIZEOF_PYOBJECT',
+ ):
+ copy_attr(info_add, f'_testinternalcapi.{name}', _testinternalcapi, name)
+
def collect_resource(info_add):
try:
@@ -907,6 +929,7 @@ def collect_info(info):
collect_sys,
collect_sysconfig,
collect_testcapi,
+ collect_testinternalcapi,
collect_time,
collect_tkinter,
collect_windows,