Mercurial > cpython-lru_cache-weakref
diff Objects/bytesobject.c @ 81934:8a747dec89c5 3.2
Issue #17034: Use Py_CLEAR() in bytesobject.c.
| author | Serhiy Storchaka <storchaka@gmail.com> |
|---|---|
| date | Sat, 02 Feb 2013 18:45:22 +0200 |
| parents | 22594c5060eb |
| children | 305210a08fc9 7e34c176aa6f |
line wrap: on
line diff
--- a/Objects/bytesobject.c Sat Feb 02 13:27:30 2013 +0200 +++ b/Objects/bytesobject.c Sat Feb 02 18:45:22 2013 +0200 @@ -2800,8 +2800,7 @@ if (*pv == NULL) return; if (w == NULL) { - Py_DECREF(*pv); - *pv = NULL; + Py_CLEAR(*pv); return; } v = bytes_concat(*pv, w); @@ -3008,12 +3007,9 @@ PyBytes_Fini(void) { int i; - for (i = 0; i < UCHAR_MAX + 1; i++) { - Py_XDECREF(characters[i]); - characters[i] = NULL; - } - Py_XDECREF(nullstring); - nullstring = NULL; + for (i = 0; i < UCHAR_MAX + 1; i++) + Py_CLEAR(characters[i]); + Py_CLEAR(nullstring); } /*********************** Bytes Iterator ****************************/
