diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-09-29 17:43:17 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-09-29 17:43:17 (GMT) |
commit | d8f6510accf000365b8953facc8fbdc5f72d7016 (patch) | |
tree | b1dd0c8d213ae818f92dd883a1b67182a092c6e2 /Include | |
parent | bc8b81bc4e28f954aa7139bec946808267790080 (diff) | |
download | cpython-d8f6510accf000365b8953facc8fbdc5f72d7016.zip cpython-d8f6510accf000365b8953facc8fbdc5f72d7016.tar.gz cpython-d8f6510accf000365b8953facc8fbdc5f72d7016.tar.bz2 |
_PyUnicode_Ready() cannot be used on ready strings anymore
* Change its prototype: PyObject* instead of PyUnicodeoObject*.
* Remove an old assertion, the result of PyUnicode_READY (_PyUnicode_Ready)
must be checked instead
Diffstat (limited to 'Include')
-rw-r--r-- | Include/unicodeobject.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index 3e9919f..a2c07f5 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -456,7 +456,7 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type; #define PyUnicode_READY(op) \ (assert(PyUnicode_Check(op)), \ (PyUnicode_IS_READY(op) ? \ - 0 : _PyUnicode_Ready((PyUnicodeObject *)(op)))) + 0 : _PyUnicode_Ready((PyObject *)(op)))) /* Return a maximum character value which is suitable for creating another string based on op. This is always an approximation but more efficient @@ -497,14 +497,16 @@ PyAPI_FUNC(PyObject*) PyUnicode_New( ); #endif -/* Initializes the canonical string representation from a the deprected - wstr/Py_UNICODE representation. This function is used to convert - unicode objects which were created using the old API to the new flexible - format introduced with PEP 393. The PyUnicode_READY() macro can be - more efficient if the string is already ready. */ +/* Initializes the canonical string representation from a the deprecated + wstr/Py_UNICODE representation. This function is used to convert Unicode + objects which were created using the old API to the new flexible format + introduced with PEP 393. + + Don't call this function directly, use the public PyUnicode_READY() macro + instead. */ #ifndef Py_LIMITED_API PyAPI_FUNC(int) _PyUnicode_Ready( - PyUnicodeObject *unicode /* Unicode object */ + PyObject *unicode /* Unicode object */ ); #endif |