From: Victor Stinner Date: Tue, 31 Oct 2017 15:41:10 +0000 (-0700) Subject: pythoninfo: add Py_DEBUG (#4198) X-Git-Tag: v3.7.0a3~275 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=afd055a59fe0291881fc2459215ce106e424da51;p=thirdparty%2FPython%2Fcpython.git pythoninfo: add Py_DEBUG (#4198) --- diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 5447ab8274b4..c238ef7b75c5 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