[Python-checkins] python/dist/src/Modules _codecsmodule.c,2.16,2.17
lemburg@users.sourceforge.net
lemburg@users.sourceforge.net
Tue, 04 Feb 2003 11:35:08 -0800
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv2848/Modules
Modified Files:
_codecsmodule.c
Log Message:
Fix for [ 543344 ] Interpreter crashes when recoding; suggested
by Michael Stone (mbrierst).
Python 2.1.4, 2.2.2 candidate.
Index: _codecsmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_codecsmodule.c,v
retrieving revision 2.16
retrieving revision 2.17
diff -C2 -d -r2.16 -r2.17
*** _codecsmodule.c 31 Oct 2002 13:36:29 -0000 2.16
--- _codecsmodule.c 4 Feb 2003 19:35:03 -0000 2.17
***************
*** 168,173 ****
return NULL;
! if (PyUnicode_Check(obj))
return codec_tuple(obj, PyUnicode_GET_SIZE(obj));
else {
if (PyObject_AsReadBuffer(obj, (const void **)&data, &size))
--- 168,175 ----
return NULL;
! if (PyUnicode_Check(obj)) {
! Py_INCREF(obj);
return codec_tuple(obj, PyUnicode_GET_SIZE(obj));
+ }
else {
if (PyObject_AsReadBuffer(obj, (const void **)&data, &size))