From d4e8e21e509fb8156bf7925ebeff435b8b6d7b78 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 1 May 2016 17:03:52 -0400 Subject: [PATCH] Postgresql: fetchone when nothing to fetch, throws exception --- gramps/plugins/database/dbapi_support/postgresql.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gramps/plugins/database/dbapi_support/postgresql.py b/gramps/plugins/database/dbapi_support/postgresql.py index 25f3415ed..e43635978 100644 --- a/gramps/plugins/database/dbapi_support/postgresql.py +++ b/gramps/plugins/database/dbapi_support/postgresql.py @@ -57,7 +57,10 @@ class Postgresql(object): raise def fetchone(self): - return self.cursor.fetchone() + try: + return self.cursor.fetchone() + except: + return None def fetchall(self): return self.cursor.fetchall()