summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--psycopg/cursor_type.c7
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