summaryrefslogtreecommitdiffstats
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 43c827f..f2d666d 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -307,8 +307,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;
@@ -427,8 +426,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;