mirror of
https://github.com/python/cpython.git
synced 2025-11-11 14:44:57 +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);
|
data = PyUnicode_AsUnicodeAndSize(arg, &datalen);
|
||||||
datalen = PyUnicode_GET_SIZE(arg);
|
if (data == NULL) {
|
||||||
|
Py_XDECREF(ucvt);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
errorcb = internal_error_callback(errors);
|
errorcb = internal_error_callback(errors);
|
||||||
if (errorcb == NULL) {
|
if (errorcb == NULL) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue