diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2013-03-20 00:44:15 +0000 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2013-03-20 01:48:11 +0000 |
commit | 16021dae6dd2d65f5d864db6dee8844f18e110c0 (patch) | |
tree | 74a0be7a821599c9d1511dbefb7696835ddea650 | |
parent | a2108593263dab4b2c647b673d3e7af6e0cf4809 (diff) | |
download | psycopg2-16021dae6dd2d65f5d864db6dee8844f18e110c0.tar.gz |
Use Py_CLEAR on self->query instead of if and decref
-rw-r--r-- | psycopg/cursor_type.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c index a6b8c80..75a953c 100644 --- a/psycopg/cursor_type.c +++ b/psycopg/cursor_type.c @@ -380,12 +380,7 @@ _psyco_curs_execute(cursorObject *self, if (operation == NULL) { goto exit; } IFCLEARPGRES(self->pgres); - - if (self->query) { - Py_DECREF(self->query); - self->query = NULL; - } - + Py_CLEAR(self->query); Dprintf("psyco_curs_execute: starting execution of new query"); /* here we are, and we have a sequence or a dictionary filled with |