summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/opensubtitles/opensubtitles.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/opensubtitles/opensubtitles.py b/src/plugins/opensubtitles/opensubtitles.py
index 341cc4350..7a6059806 100644
--- a/src/plugins/opensubtitles/opensubtitles.py
+++ b/src/plugins/opensubtitles/opensubtitles.py
@@ -205,8 +205,9 @@ class OpenSubtitlesModel (object):
try:
import locale
- self.lang = LANGUAGES[locale.getlocale ()[0].split ('_')[0]]
- except (ImportError, IndexError):
+ (language_code, _encoding) = locale.getlocale ()
+ self.lang = LANGUAGES[language_code.split ('_')[0]]
+ except (ImportError, IndexError, AttributeError):
self.lang = 'eng'
self.hash = None