From: Denis Laxalde Date: Sun, 8 Jan 2023 14:48:38 +0000 (+0100) Subject: refactor: drop superfluous _rowcount reset X-Git-Tag: pool-3.2.0~136^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=873c61a441d366a1e25532787d0cb7a80121eb52;p=thirdparty%2Fpsycopg.git 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. --- 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