[totem/gnome-3-12] opensubtitles: Don't error if the language is unknown
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/gnome-3-12] opensubtitles: Don't error if the language is unknown
- Date: Mon, 12 May 2014 13:03:58 +0000 (UTC)
commit a14404a7437e534716e59a6b8796696525a3c7ed
Author: Bastien Nocera <hadess hadess net>
Date: Mon May 12 14:39:50 2014 +0200
opensubtitles: Don't error if the language is unknown
If the current locale is not listed in our list of
OpenSubtitles-supported languages, don't throw an error, but fallback to
selecting English as the language.
https://bugzilla.gnome.org/show_bug.cgi?id=729974
src/plugins/opensubtitles/opensubtitles.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/opensubtitles/opensubtitles.py b/src/plugins/opensubtitles/opensubtitles.py
index 1ed8361..d33b704 100644
--- a/src/plugins/opensubtitles/opensubtitles.py
+++ b/src/plugins/opensubtitles/opensubtitles.py
@@ -252,7 +252,7 @@ class OpenSubtitlesModel (object):
import locale
(language_code, _) = locale.getlocale ()
self.lang = LANGUAGES[language_code.split ('_')[0]]
- except (ImportError, IndexError, AttributeError):
+ except (ImportError, IndexError, AttributeError, KeyError):
self.lang = 'eng'
self._lock = threading.Lock ()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]