mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
MultibyteCodec_Encode() checks if PyUnicode_AS_UNICODE() failed
This commit is contained in:
parent
9e30aa52fd
commit
9a80faba88
1 changed files with 5 additions and 2 deletions
|
|
@ -574,8 +574,11 @@ MultibyteCodec_Encode(MultibyteCodecObject *self,
|
|||
}
|
||||
}
|
||||
|
||||
data = PyUnicode_AS_UNICODE(arg);
|
||||
datalen = PyUnicode_GET_SIZE(arg);
|
||||
data = PyUnicode_AsUnicodeAndSize(arg, &datalen);
|
||||
if (data == NULL) {
|
||||
Py_XDECREF(ucvt);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
errorcb = internal_error_callback(errors);
|
||||
if (errorcb == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue