8000 bpo-38376: Fix _PyUnicode_CheckConsistency() definition (GH-16623) · python/cpython@435b2ee · GitHub
[go: up one dir, main page]

Skip to content

Commit 435b2ee

Browse files
authored
bpo-38376: Fix _PyUnicode_CheckConsistency() definition (GH-16623)
Always define _PyUnicode_CheckConsistency() in the CPython C API.
1 parent 13915a3 commit 435b2ee

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

Include/cpython/unicodeobject.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,10 @@ typedef struct {
246246
} data; /* Canonical, smallest-form Unicode buffer */
247247
} PyUnicodeObject;
248248

249+
PyAPI_FUNC(int) _PyUnicode_CheckConsistency(
250+
PyObject *op,
251+
int check_content);
252+
249253
/* Fast access macros */
250254
#define PyUnicode_WSTR_LENGTH(op) \
251255
(PyUnicode_IS_COMPACT_ASCII(op) ? \

Include/internal/pycore_object.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ extern "C" {
1111
#include "pycore_pystate.h" /* _PyRuntime */
1212

1313
PyAPI_FUNC(int) _PyType_CheckConsistency(PyTypeObject *type);
14-
PyAPI_FUNC(int) _PyUnicode_CheckConsistency(PyObject *op, int check_content);
1514
PyAPI_FUNC(int) _PyDict_CheckConsistency(PyObject *mp, int check_content);
1615

1716
/* Tell the GC to track this object.

Include/unicodeobject.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,16 +1032,6 @@ PyAPI_FUNC(int) PyUnicode_IsIdentifier(PyObject *s);
10321032

10331033
/* === Characters Type APIs =============================================== */
10341034

1035-
#if defined(Py_DEBUG) && !defined(Py_LIMITED_API)
1036-
PyAPI_FUNC(int) _PyUnicode_CheckConsistency(
1037-
PyObject *op,
1038-
int check_content);
1039-
#elif !defined(NDEBUG)
1040-
/* For asserts that call _PyUnicode_CheckConsistency(), which would
1041-
* otherwise be a problem when building with asserts but without Py_DEBUG. */
1042-
#define _PyUnicode_CheckConsistency(op, check_content) PyUnicode_Check(op)
1043-
#endif
1044-
10451035
#ifndef Py_LIMITED_API
10461036
# define Py_CPYTHON_UNICODEOBJECT_H
10471037
# include "cpython/unicodeobject.h"

0 commit comments

Comments
 (0)
0