summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-04-23 21:36:38 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2012-04-23 21:36:38 (GMT)
commitece58deb9fd72674b84ef7a01c944b5eed6b37a1 (patch)
tree040cbeefd99fc35b73a9a9505efb58a61177eda4 /Include
parent0b7d7c95448e157d4376751add831aecbd53808e (diff)
downloadcpython-ece58deb9fd72674b84ef7a01c944b5eed6b37a1.zip
cpython-ece58deb9fd72674b84ef7a01c944b5eed6b37a1.tar.gz
cpython-ece58deb9fd72674b84ef7a01c944b5eed6b37a1.tar.bz2
Close #14648: Compute correctly maxchar in str.format() for substrin
Diffstat (limited to 'Include')
-rw-r--r--Include/unicodeobject.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 8f74995..486d4fa 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -710,6 +710,15 @@ PyAPI_FUNC(PyObject*) PyUnicode_Substring(
Py_ssize_t start,
Py_ssize_t end);
+#ifndef Py_LIMITED_API
+/* Compute the maximum character of the substring unicode[start:end].
+ Return 127 for an empty string. */
+PyAPI_FUNC(Py_UCS4) _PyUnicode_FindMaxChar (
+ PyObject *unicode,
+ Py_ssize_t start,
+ Py_ssize_t end);
+#endif
+
/* Copy the string into a UCS4 buffer including the null character if copy_null
is set. Return NULL and raise an exception on error. Raise a ValueError if
the buffer is smaller than the string. Return buffer on success.