Skip to content

Commit 5defb17

Browse files
committed
Stop defining NDEBUG in Python.h, because it can interfere with
extensions that #include Python.h. See (rejected) patch 487634 for more detail. I'll open a new bug report for the rest needed here.
1 parent ecd8157 commit 5defb17

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

‎Include/Python.h‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@
5050
#include <stdlib.h>
5151
#endif
5252

53-
#ifndef Py_DEBUG
54-
#ifndef NDEBUG
55-
#define NDEBUG 1
56-
#endif
57-
#endif
53+
/* CAUTION: Build setups should ensure that NDEBUG is defined on the
54+
* compiler command line when building Python in release mode; else
55+
* assert() calls won't be removed.
56+
*/
5857
#include <assert.h>
5958

6059
#include "pyport.h"

0 commit comments

Comments
 (0)