Merge pull request #1411 from wxWidgets/fix-locale-error

Handle a ValueError from locale.getlocale()

(cherry picked from commit 4353c7deb6)
This commit is contained in:
Robin Dunn
2019-10-23 17:41:59 -07:00
parent dcef0c5209
commit 03814de6b6

View File

@@ -522,7 +522,10 @@ def run():
body="""\
self.ResetLocale()
import locale
loc, enc = locale.getlocale()
try:
loc, enc = locale.getlocale()
except ValueError:
loc = enc = None
# Try to set it to the same language as what is already set in the C locale
info = wx.Locale.FindLanguageInfo(loc) if loc else None
if info: