mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Fix for [ 543344 ] Interpreter crashes when recoding; suggested
by Michael Stone (mbrierst). Python 2.1.4, 2.2.2 candidate.
This commit is contained in:
parent
604ade4ebd
commit
29273c87da
2 changed files with 12 additions and 1 deletions
|
@ -167,8 +167,10 @@ unicode_internal_decode(PyObject *self,
|
|||
&obj, &errors))
|
||||
return NULL;
|
||||
|
||||
if (PyUnicode_Check(obj))
|
||||
if (PyUnicode_Check(obj)) {
|
||||
Py_INCREF(obj);
|
||||
return codec_tuple(obj, PyUnicode_GET_SIZE(obj));
|
||||
}
|
||||
else {
|
||||
if (PyObject_AsReadBuffer(obj, (const void **)&data, &size))
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue