diff options
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r-- | Objects/unicodeobject.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 199f34a..028b42d 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -294,8 +294,7 @@ int unicode_resize(register PyUnicodeObject *unicode, reset: /* Reset the object caches */ if (unicode->defenc) { - Py_DECREF(unicode->defenc); - unicode->defenc = NULL; + Py_CLEAR(unicode->defenc); } unicode->hash = -1; @@ -414,8 +413,7 @@ void unicode_dealloc(register PyUnicodeObject *unicode) unicode->length = 0; } if (unicode->defenc) { - Py_DECREF(unicode->defenc); - unicode->defenc = NULL; + Py_CLEAR(unicode->defenc); } /* Add to free list */ *(PyUnicodeObject **)unicode = free_list; |