From: Martin v. Löwis Date: Mon, 14 Oct 2002 21:11:34 +0000 (+0000) Subject: Don't drop old slots if _unicode_to_string did not change anything. X-Git-Tag: v2.3c1~3776 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=13b1a5cc990e4bbffa47d58a6769b5940da7548e;p=thirdparty%2FPython%2Fcpython.git Don't drop old slots if _unicode_to_string did not change anything. --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index cfd540958bab..e11b87f62001 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -1169,8 +1169,10 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds) #ifdef Py_USING_UNICODE tmp = _unicode_to_string(slots, nslots); - Py_DECREF(slots); - slots = tmp; + if (tmp != slots) { + Py_DECREF(slots); + slots = tmp; + } if (!tmp) return NULL; #endif