[Python-checkins] python/dist/src/Objects typeobject.c,2.180,2.181
loewis@users.sourceforge.net
loewis@users.sourceforge.net
Mon, 14 Oct 2002 14:11:38 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv1644
Modified Files:
typeobject.c
Log Message:
Don't drop old slots if _unicode_to_string did not change anything.
Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.180
retrieving revision 2.181
diff -C2 -d -r2.180 -r2.181
*** typeobject.c 14 Oct 2002 21:07:28 -0000 2.180
--- typeobject.c 14 Oct 2002 21:11:34 -0000 2.181
***************
*** 1170,1175 ****
#ifdef Py_USING_UNICODE
tmp = _unicode_to_string(slots, nslots);
! Py_DECREF(slots);
! slots = tmp;
if (!tmp)
return NULL;
--- 1170,1177 ----
#ifdef Py_USING_UNICODE
tmp = _unicode_to_string(slots, nslots);
! if (tmp != slots) {
! Py_DECREF(slots);
! slots = tmp;
! }
if (!tmp)
return NULL;