Don't check for the maximum character when copying from unicodeobject.c
* Create copy_characters() function which doesn't check for the maximum
character in release mode
* _PyUnicode_CheckConsistency() is no more static to be able to use it
in _PyUnicode_FormatAdvanced() (in formatter_unicode.c)
* _PyUnicode_CheckConsistency() checks the string hash
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 6fdcd7b..dac9c32 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -2030,6 +2030,13 @@
);
#endif /* Py_LIMITED_API */
+#if defined(Py_DEBUG) && !defined(Py_LIMITED_API)
+/* FIXME: use PyObject* type for op */
+PyAPI_FUNC(int) _PyUnicode_CheckConsistency(
+ void *op,
+ int check_content);
+#endif
+
#ifdef __cplusplus
}
#endif