From 873c61a441d366a1e25532787d0cb7a80121eb52 Mon Sep 17 00:00:00 2001 From: Denis Laxalde Date: Sun, 8 Jan 2023 15:48:38 +0100 Subject: [PATCH] refactor: drop superfluous _rowcount reset In BaseCursor._set_results_from_pipeline() we were resetting _rowcount if negative. This is superfluous as this code is reached when coming from _executemany_gen_pipeline() in which we already do 'self._rowcount = 0' early on. --- psycopg/psycopg/cursor.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/psycopg/psycopg/cursor.py b/psycopg/psycopg/cursor.py index 42c3804a1..08cdcb751 100644 --- a/psycopg/psycopg/cursor.py +++ b/psycopg/psycopg/cursor.py @@ -551,8 +551,6 @@ class BaseCursor(Generic[ConnectionType, Row]): # change it to the value of that result only, but we hope nobody # will notice. # You haven't read this comment. - if self._rowcount < 0: - self._rowcount = 0 for res in results: self._rowcount += res.command_tuples or 0 -- 2.47.3