From 5117028c52ec8e76c1427f75b217b3270dddbf19 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Thu, 6 Aug 2020 13:12:45 -0400 Subject: [PATCH] misc: ignore exceptions when trying to set locale --- lib/solaar/i18n.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/solaar/i18n.py b/lib/solaar/i18n.py index 7cea6ba0..9d7455fd 100644 --- a/lib/solaar/i18n.py +++ b/lib/solaar/i18n.py @@ -47,7 +47,11 @@ def _find_locale_path(lc_domain): # del _path -locale.setlocale(locale.LC_ALL, '') +try: + locale.setlocale(locale.LC_ALL, '') +except Exception: + pass + language, encoding = locale.getlocale() del locale