commit | 13b1a5cc990e4bbffa47d58a6769b5940da7548e | [log] [tgz] |
---|---|---|
author | Martin v. Löwis <martin@v.loewis.de> | Mon Oct 14 21:11:34 2002 +0000 |
committer | Martin v. Löwis <martin@v.loewis.de> | Mon Oct 14 21:11:34 2002 +0000 |
tree | 0d6daa2680aa3a8a72d5683b52888085badb38df | |
parent | d919a59ab58be7dec14ea78c182b8d4545559adb [diff] [blame] |
Don't drop old slots if _unicode_to_string did not change anything.
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 @@ #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