[Python-checkins] pythoninfo: add Py_DEBUG (#4198) (#4580)

Victor Stinner webhook-mailer at python.org
Mon Nov 27 04:44:56 EST 2017


https://github.com/python/cpython/commit/d5c71b0c9862c4474d2700a14490dc98b67da88e
commit: d5c71b0c9862c4474d2700a14490dc98b67da88e
branch: 3.6
author: Victor Stinner <victor.stinner at gmail.com>
committer: GitHub <noreply at github.com>
date: 2017-11-27T10:44:53+01:00
summary:

pythoninfo: add Py_DEBUG (#4198) (#4580)

(cherry picked from commit afd055a59fe0291881fc2459215ce106e424da51)

files:
M Lib/test/pythoninfo.py

diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
index 5447ab8274b..c238ef7b75c 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



More information about the Python-checkins mailing list