From 8fbd9155d37acf1b449a0769967b98306d57ce66 Mon Sep 17 00:00:00 2001 From: echel0n Date: Thu, 5 Jun 2014 02:13:29 -0700 Subject: [PATCH] fix for recent sql errors around connection object --- sickbeard/db.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sickbeard/db.py b/sickbeard/db.py index a56d9702..4ff56ee7 100644 --- a/sickbeard/db.py +++ b/sickbeard/db.py @@ -126,7 +126,6 @@ class DBConnection: while attempt < 5: try: - with self.connection as trans: for qu in querylist: if len(qu) == 1: @@ -142,8 +141,8 @@ class DBConnection: return sqlResult except sqlite3.OperationalError, e: sqlResult = [] - if trans.connection: - trans.rollback() + if self.connection: + self.connection.rollback() if "unable to open database file" in e.args[0] or "database is locked" in e.args[0]: logger.log(u"DB error: " + ex(e), logger.WARNING) attempt += 1 @@ -152,8 +151,8 @@ class DBConnection: raise except sqlite3.DatabaseError, e: sqlResult = [] - if trans.connection: - trans.rollback() + if self.connection: + self.connection.rollback() logger.log(u"Fatal error executing query: " + ex(e), logger.ERROR) raise