]> granicus.if.org Git - python/commitdiff
pythoninfo: add Py_DEBUG (#4198) (#4581)
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 27 Nov 2017 09:44:50 +0000 (10:44 +0100)
committerGitHub <noreply@github.com>
Mon, 27 Nov 2017 09:44:50 +0000 (10:44 +0100)
(cherry picked from commit afd055a59fe0291881fc2459215ce106e424da51)

Lib/test/pythoninfo.py

index 83b1ec726e4a1031c7bb849fcfac38fa83ace5c9..8b029330a2ee507a1a9b9853c2fa05eccb19ea54 100644 (file)
@@ -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