Skip to content

Commit afd055a

Browse files
authored
pythoninfo: add Py_DEBUG (python#4198)
1 parent e1a470b commit afd055a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: Lib/test/pythoninfo.py

+8
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ def collect_sys(info_add):
115115
encoding = '%s/%s' % (encoding, errors)
116116
info_add('sys.%s.encoding' % name, encoding)
117117

118+
# Were we compiled --with-pydebug or with #define Py_DEBUG?
119+
Py_DEBUG = hasattr(sys, 'gettotalrefcount')
120+
if Py_DEBUG:
121+
text = 'Yes (sys.gettotalrefcount() present)'
122+
else:
123+
text = 'No (sys.gettotalrefcount() missing)'
124+
info_add('Py_DEBUG', text)
125+
118126

119127
def collect_platform(info_add):
120128
import platform

0 commit comments

Comments
 (0)