From 7875d455044ff3b09b574c53e28827777bc35ad8 Mon Sep 17 00:00:00 2001 From: Nils Vogels Date: Sun, 11 May 2014 00:51:57 +0200 Subject: [PATCH] Add exception handing if logout fails for opensubtitles --- lib/subliminal/services/opensubtitles.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/subliminal/services/opensubtitles.py b/lib/subliminal/services/opensubtitles.py index 65599d24..cc75248e 100644 --- a/lib/subliminal/services/opensubtitles.py +++ b/lib/subliminal/services/opensubtitles.py @@ -97,7 +97,11 @@ class OpenSubtitles(ServiceBase): def terminate(self): super(OpenSubtitles, self).terminate() if self.token: - self.server.LogOut(self.token) + try: + self.server.LogOut(self.token) + except Exception as e: + raise ServiceError(str(e)) + def query(self, filepath, languages, moviehash=None, size=None, imdbid=None, query=None): searches = []