From 16021dae6dd2d65f5d864db6dee8844f18e110c0 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Wed, 20 Mar 2013 00:44:15 +0000 Subject: [PATCH] Use Py_CLEAR on self->query instead of if and decref --- psycopg/cursor_type.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c index a6b8c80b..75a953cc 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