[Python-checkins] bpo-39849: Enable assertions in _testcapimodule.c and _testinternalcapi.c (GH-19623)

Hai Shi webhook-mailer at python.org
Mon Apr 20 12:49:25 EDT 2020


https://github.com/python/cpython/commit/5dd21f5d1c9b5a9316deca4535932675f04efeee
commit: 5dd21f5d1c9b5a9316deca4535932675f04efeee
branch: master
author: Hai Shi <shihai1992 at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-04-21T01:49:13+09:00
summary:

bpo-39849: Enable assertions in _testcapimodule.c and _testinternalcapi.c (GH-19623)

files:
M Modules/_testcapimodule.c
M Modules/_testinternalcapi.c

diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 8e18b14a0a890..101d54932d913 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -10,7 +10,10 @@
 
    The Visual Studio projects builds _testcapi with Py_BUILD_CORE_MODULE
    macro defined, but only the public C API must be tested here. */
+
 #undef Py_BUILD_CORE_MODULE
+/* Always enable assertions */
+#undef NDEBUG
 
 #define PY_SSIZE_T_CLEAN
 
diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c
index 9330e2625b3a0..1b7563cb20fc5 100644
--- a/Modules/_testinternalcapi.c
+++ b/Modules/_testinternalcapi.c
@@ -6,6 +6,9 @@
 #  error "Py_BUILD_CORE_BUILTIN or Py_BUILD_CORE_MODULE must be defined"
 #endif
 
+/* Always enable assertions */
+#undef NDEBUG
+
 #define PY_SSIZE_T_CLEAN
 
 #include "Python.h"



More information about the Python-checkins mailing list