diff options
| author | Thomas Wouters <thomas@python.org> | 2006-04-15 17:28:34 (GMT) |
|---|---|---|
| committer | Thomas Wouters <thomas@python.org> | 2006-04-15 17:28:34 (GMT) |
| commit | edf17d8798e65c10c970ef86f7374f6c1b51027a (patch) | |
| tree | 743ac540a38640d5b550c9b9636ca8ee5f86a0dd /Modules/_csv.c | |
| parent | ed8f78312654d74329892252d720d78765495c38 (diff) | |
| download | cpython-edf17d8798e65c10c970ef86f7374f6c1b51027a.zip cpython-edf17d8798e65c10c970ef86f7374f6c1b51027a.tar.gz cpython-edf17d8798e65c10c970ef86f7374f6c1b51027a.tar.bz2 | |
Use Py_CLEAR instead of in-place DECREF/XDECREF or custom macros, for
tp_clear methods.
Diffstat (limited to 'Modules/_csv.c')
| -rw-r--r-- | Modules/_csv.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Modules/_csv.c b/Modules/_csv.c index 902ea9e..88c7248 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -828,12 +828,9 @@ Reader_traverse(ReaderObj *self, visitproc visit, void *arg) static int Reader_clear(ReaderObj *self) { - Py_XDECREF(self->dialect); - Py_XDECREF(self->input_iter); - Py_XDECREF(self->fields); - self->dialect = NULL; - self->input_iter = NULL; - self->fields = NULL; + Py_CLEAR(self->dialect); + Py_CLEAR(self->input_iter); + Py_CLEAR(self->fields); return 0; } @@ -1260,10 +1257,8 @@ Writer_traverse(WriterObj *self, visitproc visit, void *arg) static int Writer_clear(WriterObj *self) { - Py_XDECREF(self->dialect); - Py_XDECREF(self->writeline); - self->dialect = NULL; - self->writeline = NULL; + Py_CLEAR(self->dialect); + Py_CLEAR(self->writeline); return 0; } |
