bpo-38376: Fix build error when enabling assertions but not Py_DEBUG.#16594
bpo-38376: Fix build error when enabling assertions but not Py_DEBUG.#16594Yhg1s wants to merge 1 commit intopython:masterfrom
Conversation
_PyUnicode_CheckConsistency is now defined even without Py_DEBUG set, so get rid of the #define hack that was there to deal with calls in assert statements not explicitly guarded by Py_DEBUG.
|
In short, _PyUnicode_CheckConsistency() is now always available in Python 3.8. I wrote PR #16623 to fix its definition in header files. This change doesn't look correct. I'm not sure that _PyUnicode_CheckConsistency() definition depends on NDEBUG macro. |
|
I merged my PR #16623 instead. |
|
FYI, this change was intended to keep visibility parity, because the existing declaration (not definition) of _PyUnicode_CheckConsistency in Include/unicodeobject.h was already conditional on NDEBUG or Py_DEBUG. The only other declaration was in Include/internal/pycore_object.h, which wouldn't be visible to user code in the same way as before. Moving the declaration to Include/cpython/unicodeobject.h as you did also solved that same problem, because that header is included by Include/unicodeobject.h when not using the limited API. We should be all good now. |
_PyUnicode_CheckConsistency is now defined even without Py_DEBUG set, so get rid of the #define hack that was there to deal with calls in assert statements not explicitly guarded by Py_DEBUG.
https://bugs.python.org/issue38376