From 4b78ad72c728093a4c76f586c8c32c2b730e7de8 Mon Sep 17 00:00:00 2001 From: Andreas <andreasv@fsmpi.rwth-aachen.de> Date: Sun, 9 Oct 2016 23:42:02 +0200 Subject: [PATCH] fixed errors.InterfaceError("No result set to fetch from.") --- db.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/db.py b/db.py index fe6ae4a..6678966 100644 --- a/db.py +++ b/db.py @@ -61,7 +61,14 @@ def query(operation, *params, delim="sep"): operation, params = fix_query(operation, params) cur = get_dbcursor() cur.execute(operation, params) - rows = cur.fetchall() + try + rows = cur.fetchall() + except mysql.connector.errors.InterfaceError as ie: + if ie.msg == 'No result set to fetch from.': + # no problem, we were just at the end of the result set + pass + else: + raise res = [] for row in rows: res.append({}) -- GitLab