From a70fb7f66f22d74c0fad39e2a6c8c1c7d850542a Mon Sep 17 00:00:00 2001 From: Alexandre Beloin Date: Tue, 17 Feb 2015 19:03:57 -0500 Subject: [PATCH] AniDB: Fix generating exception on timeout in auth --- sickbeard/helpers.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index f101c6aa..3d42e02d 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -1014,14 +1014,14 @@ def set_up_anidb_connection(): logger.log(u"anidb exception msg: " + str(e)) return False - if not sickbeard.ADBA_CONNECTION.authed(): - try: + try: + if not sickbeard.ADBA_CONNECTION.authed(): sickbeard.ADBA_CONNECTION.auth(sickbeard.ANIDB_USERNAME, sickbeard.ANIDB_PASSWORD) - except Exception, e: - logger.log(u"anidb exception msg: " + str(e)) - return False - else: - return True + else: + return True + except Exception as e: + logger.log(u"anidb exception msg: " + str(e)) + return False return sickbeard.ADBA_CONNECTION.authed()