]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
pythoninfo: add Py_DEBUG (#4198)
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 31 Oct 2017 15:41:10 +0000 (08:41 -0700)
committerGitHub <noreply@github.com>
Tue, 31 Oct 2017 15:41:10 +0000 (08:41 -0700)
Lib/test/pythoninfo.py

index 5447ab8274b4e7d95eb4d04bf2c8a8350073d574..c238ef7b75c5bd6db4de21e5299590b7cb871504 100644 (file)
@@ -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