summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-10-31 15:41:10 (GMT)
committerGitHub <noreply@github.com>2017-10-31 15:41:10 (GMT)
commitafd055a59fe0291881fc2459215ce106e424da51 (patch)
tree8df1213ce2c0d5797b64f0000898dbcf32d0fb94 /Lib
parente1a470bd6ae87f9501b8830caa64e7a8df0a2302 (diff)
downloadcpython-afd055a59fe0291881fc2459215ce106e424da51.zip
cpython-afd055a59fe0291881fc2459215ce106e424da51.tar.gz
cpython-afd055a59fe0291881fc2459215ce106e424da51.tar.bz2
pythoninfo: add Py_DEBUG (#4198)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/pythoninfo.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
index 5447ab8..c238ef7 100644
--- a/Lib/test/pythoninfo.py
+++ b/Lib/test/pythoninfo.py
@@ -115,6 +115,14 @@ def collect_sys(info_add):
encoding = '%s/%s' % (encoding, errors)
info_add('sys.%s.encoding' % name, encoding)
+ # Were we compiled --with-pydebug or with #define Py_DEBUG?
+ Py_DEBUG = hasattr(sys, 'gettotalrefcount')
+ if Py_DEBUG:
+ text = 'Yes (sys.gettotalrefcount() present)'
+ else:
+ text = 'No (sys.gettotalrefcount() missing)'
+ info_add('Py_DEBUG', text)
+
def collect_platform(info_add):
import platform