summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-10-14 21:11:34 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-10-14 21:11:34 (GMT)
commit13b1a5cc990e4bbffa47d58a6769b5940da7548e (patch)
tree0d6daa2680aa3a8a72d5683b52888085badb38df /Objects
parentd919a59ab58be7dec14ea78c182b8d4545559adb (diff)
downloadcpython-13b1a5cc990e4bbffa47d58a6769b5940da7548e.zip
cpython-13b1a5cc990e4bbffa47d58a6769b5940da7548e.tar.gz
cpython-13b1a5cc990e4bbffa47d58a6769b5940da7548e.tar.bz2
Don't drop old slots if _unicode_to_string did not change anything.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index cfd5409..e11b87f 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