Skip to content

Commit 70d2f27

Browse files
fix Error executing query (#110)
1 parent 40aa655 commit 70d2f27

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

testgres/connection.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ def rollback(self):
104104
def execute(self, query, *args):
105105
self.cursor.execute(query, args)
106106
try:
107-
res = self.cursor.fetchall()
108107
# pg8000 might return tuples
109-
if isinstance(res, tuple):
110-
res = [tuple(t) for t in res]
111-
108+
res = [tuple(t) for t in self.cursor.fetchall()]
112109
return res
113-
except Exception:
110+
except ProgrammingError:
111+
return None
112+
except Exception as e:
113+
print("Error executing query: {}\n {}".format(repr(e), query))
114114
return None
115115

116116
def close(self):

0 commit comments

Comments
 (0)
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