summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-07-29 14:23:06 (GMT)
committerGeorg Brandl <georg@python.org>2010-07-29 14:23:06 (GMT)
commit8ee604b9890e02c4ed2fcf12f0223d8c8c4c7508 (patch)
tree152da8c3f8a8f58cbff0ab25df5f0cb616e26675 /Objects
parent470a123910c1f1d71f379d1ffdd84f2161c3bc20 (diff)
downloadcpython-8ee604b9890e02c4ed2fcf12f0223d8c8c4c7508.zip
cpython-8ee604b9890e02c4ed2fcf12f0223d8c8c4c7508.tar.gz
cpython-8ee604b9890e02c4ed2fcf12f0223d8c8c4c7508.tar.bz2
Use Py_CLEAR().
Diffstat (limited to 'Objects')
-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;