summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2011-04-08 14:06:25 +0100
committerPhilip Withnall <philip@tecnocode.co.uk>2011-04-09 14:04:55 +0100
commit6833b7f7bf15dbaba6687d56b52230aca5af6b62 (patch)
treeb5fa536bd991767adb0af1e62325038dae2a2fab /src
parentcb3299f89bc03bd128972c79b9c4b22120e6a5f9 (diff)
downloadtotem-6833b7f7bf15dbaba6687d56b52230aca5af6b62.tar.gz
opensubtitles: Improve locale error handling
Diffstat (limited to 'src')
-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