From: Victor Stinner Date: Mon, 27 Nov 2017 09:44:50 +0000 (+0100) Subject: pythoninfo: add Py_DEBUG (#4198) (#4581) X-Git-Tag: v2.7.15rc1~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=180372c08a25332429f6175d6aa036c1ec643ca3;p=python pythoninfo: add Py_DEBUG (#4198) (#4581) (cherry picked from commit afd055a59fe0291881fc2459215ce106e424da51) --- diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 83b1ec726e..8b029330a2 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -104,6 +104,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