diff options
Diffstat (limited to 'Doc/c-api/unicode.rst')
-rw-r--r-- | Doc/c-api/unicode.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst index 5515ec3..9dea2d5 100644 --- a/Doc/c-api/unicode.rst +++ b/Doc/c-api/unicode.rst @@ -1643,6 +1643,9 @@ They all return *NULL* or ``-1`` if an exception occurs. Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, and greater than, respectively. + This function returns ``-1`` upon failure, so one should call + :c:func:`PyErr_Occurred` to check for errors. + .. c:function:: int PyUnicode_CompareWithASCIIString(PyObject *uni, const char *string) @@ -1651,6 +1654,9 @@ They all return *NULL* or ``-1`` if an exception occurs. ASCII-encoded strings, but the function interprets the input string as ISO-8859-1 if it contains non-ASCII characters. + This function returns ``-1`` upon failure, so one should call + :c:func:`PyErr_Occurred` to check for errors. + .. c:function:: PyObject* PyUnicode_RichCompare(PyObject *left, PyObject *right, int op) |