Also catch the locale.Error exception

This commit is contained in:
Robin Dunn
2020-07-02 16:15:03 -07:00
parent 90176323bd
commit 2573b6de8e

View File

@@ -519,7 +519,7 @@ def run():
lang, enc = locale.getdefaultlocale()
self._initial_locale = wx.Locale(lang, lang[:2], lang)
locale.setlocale(locale.LC_ALL, lang)
except ValueError as ex:
except (ValueError, locale.Error) as ex:
target = wx.LogStderr()
orig = wx.Log.SetActiveTarget(target)
wx.LogError("Unable to set default locale: '{}'".format(ex))