From e890625a239d1bcfd7258e21150ae294b30d28e4 Mon Sep 17 00:00:00 2001 From: "z.kasymalieva" Date: Thu, 1 Feb 2024 16:38:31 +0300 Subject: [PATCH] fix Error executing query --- testgres/connection.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testgres/connection.py b/testgres/connection.py index 882498a9..49b74844 100644 --- a/testgres/connection.py +++ b/testgres/connection.py @@ -104,13 +104,13 @@ def rollback(self): def execute(self, query, *args): self.cursor.execute(query, args) try: - res = self.cursor.fetchall() # pg8000 might return tuples - if isinstance(res, tuple): - res = [tuple(t) for t in res] - + res = [tuple(t) for t in self.cursor.fetchall()] return res - except Exception: + except ProgrammingError: + return None + except Exception as e: + print("Error executing query: {}\n {}".format(repr(e), query)) return None def close(self): pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy