summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmenuconfig.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/menuconfig.py b/menuconfig.py
index 21b5f54..9c5732a 100755
--- a/menuconfig.py
+++ b/menuconfig.py
@@ -703,8 +703,12 @@ def menuconfig(kconf):
# errors ourselves.
kconf.warn = False
- # Make curses use the locale settings specified in the environment
- locale.setlocale(locale.LC_ALL, "")
+ try:
+ # Make curses use the locale settings specified in the environment
+ locale.setlocale(locale.LC_ALL, "")
+ except locale.Error:
+ # fall back to the default locale
+ locale.setlocale(locale.LC_ALL, "C")
# Try to fix Unicode issues on systems with bad defaults
if _CHANGE_C_LC_CTYPE_TO_UTF8: