aboutsummaryrefslogtreecommitdiffstats
path: root/python/db.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/db.py')
-rw-r--r--python/db.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/python/db.py b/python/db.py
index 1fe42b85..a47c44c6 100644
--- a/python/db.py
+++ b/python/db.py
@@ -28,7 +28,10 @@ def query_db(conn, sqlstr, params=None, one=True):
else:
c.execute(sqlstr)
if one:
- return c.fetchone()
+ r = c.fetchone()
+ c.close()
+ return r
else:
- return c.fetchall()
- c.close()
+ r = c.fetchall()
+ c.close()
+ return r