From b9dd144afe8c20d7965aac6e5325282ed848caef Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Wed, 2 Nov 2022 11:21:21 +0100 Subject: [PATCH] fix(c): drop duplicate PQconsumeInput call Also add a couple of C types in the function for better C code. --- psycopg_c/psycopg_c/_psycopg/generators.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/psycopg_c/psycopg_c/_psycopg/generators.pyx b/psycopg_c/psycopg_c/_psycopg/generators.pyx index 5a9215282..e45314a13 100644 --- a/psycopg_c/psycopg_c/_psycopg/generators.pyx +++ b/psycopg_c/psycopg_c/_psycopg/generators.pyx @@ -212,6 +212,8 @@ def pipeline_communicate( cdef object notify_handler = pgconn.notify_handler cdef libpq.PGnotify *notify cdef int cires + cdef int status + cdef int ready cdef libpq.PGresult *pgres cdef list res = [] cdef list results = [] @@ -221,7 +223,6 @@ def pipeline_communicate( ready = yield WAIT_RW if ready & READY_R: - pgconn.consume_input() with nogil: cires = libpq.PQconsumeInput(pgconn_ptr) if 1 != cires: -- 2.47.2