From: Daniele Varrazzo Date: Wed, 2 Nov 2022 10:21:21 +0000 (+0100) Subject: fix(c): drop duplicate PQconsumeInput call X-Git-Tag: pool-3.1.4~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9dd144afe8c20d7965aac6e5325282ed848caef;p=thirdparty%2Fpsycopg.git fix(c): drop duplicate PQconsumeInput call Also add a couple of C types in the function for better C code. --- 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: