From 0599a89565dcfc3ef433fea6e0f836456db36f4f Mon Sep 17 00:00:00 2001 From: echel0n Date: Sun, 22 Jun 2014 18:24:55 -0700 Subject: [PATCH] Fix for DB issues on new installs relating to database version checks. --- sickbeard/db.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sickbeard/db.py b/sickbeard/db.py index 0f46f68e..2097d2d3 100644 --- a/sickbeard/db.py +++ b/sickbeard/db.py @@ -105,10 +105,10 @@ class DBConnection(object): result = None try: - result = self.select("SELECT db_version FROM db_version") - except sqlite3.OperationalError, e: - if "no such table: db_version" in e.args[0]: - return 0 + if self.hasTable('db_version'): + result = self.select("SELECT db_version FROM db_version") + except: + pass if result: return int(result[0]["db_version"])