diff options
-rw-r--r-- | setup/main.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/setup/main.py b/setup/main.py index 3c13c4c..3f153a5 100644 --- a/setup/main.py +++ b/setup/main.py @@ -45,7 +45,12 @@ class PreferencesDialog: locale.setlocale(locale.LC_ALL, "") localedir = os.getenv("IBUS_LOCALEDIR") gettext.bindtextdomain("ibus-pinyin", localedir) - gettext.bind_textdomain_codeset("ibus-pinyin", "UTF-8") + # Python's gettext module doesn't provide all methods in + # new Python version since Python 3.10 + try: + gettext.bind_textdomain_codeset("ibus-pinyin", "UTF-8") + except AttributeError: + pass self.__bus = IBus.Bus() self.__config = self.__bus.get_config() |