From 9fb927a0682773a399d2bc462af380f502888e9d Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 23 Apr 2018 20:06:54 +0200 Subject: [PATCH] minor py3 fix: language setting in qt/preferences --- gui/qt/main_window.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index 1edec3959..3f381cfeb 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -2606,9 +2606,11 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): lang_combo = QComboBox() from electrum.i18n import languages lang_combo.addItems(list(languages.values())) + lang_keys = list(languages.keys()) + lang_cur_setting = self.config.get("language", '') try: - index = languages.keys().index(self.config.get("language",'')) - except Exception: + index = lang_keys.index(lang_cur_setting) + except ValueError: # not in list index = 0 lang_combo.setCurrentIndex(index) if not self.config.is_modifiable('language'):