From 67ae7af226476df91e38cedf3b98a6f81d2fa6e7 Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 25 Jun 2014 17:12:52 -0700 Subject: [PATCH] Testing fix for 500 internal server error/TypeError: argument of type 'NoneType' is not iterable --- SickBeard.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/SickBeard.py b/SickBeard.py index 96c7d793..52e985bd 100755 --- a/SickBeard.py +++ b/SickBeard.py @@ -311,9 +311,7 @@ def main(): sickbeard.CFG = ConfigObj(sickbeard.CONFIG_FILE) - myDB = db.DBConnection() - - CUR_DB_VERSION = myDB.checkDBVersion() + CUR_DB_VERSION = db.DBConnection().checkDBVersion() if CUR_DB_VERSION > 0: if CUR_DB_VERSION < MIN_DB_VERSION: @@ -327,16 +325,20 @@ def main(): MAX_DB_VERSION) + ").\n" + \ "If you have used other forks of SB, your database may be unusable due to their modifications.") + # Initialize the config and our threads + sickbeard.initialize(consoleLogging=consoleLogging) + + sickbeard.showList = [] + if sickbeard.DAEMON: daemonize() # Use this PID for everything sickbeard.PID = os.getpid() - # Initialize the config and our threads - sickbeard.initialize(consoleLogging=consoleLogging) - - sickbeard.showList = [] + # Build from the DB to start with + logger.log(u"Loading initial show list") + loadShowsFromDB() if forcedPort: logger.log(u"Forcing web server to port " + str(forcedPort)) @@ -376,10 +378,6 @@ def main(): # init tornado webserveInit.initWebServer(options) - # Build from the DB to start with - logger.log(u"Loading initial show list") - loadShowsFromDB() - def startup(): # Fire up all our threads sickbeard.start()