Skip to content

Commit 1e6f644

Browse files
Iksastejlmand
authored andcommitted
fix crash caused by unsupported locales
1 parent 0380400 commit 1e6f644

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

menuconfig.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,12 @@ def menuconfig(kconf):
703703
# errors ourselves.
704704
kconf.warn = False
705705

706-
# Make curses use the locale settings specified in the environment
707-
locale.setlocale(locale.LC_ALL, "")
706+
try:
707+
# Make curses use the locale settings specified in the environment
708+
locale.setlocale(locale.LC_ALL, "")
709+
except locale.Error:
710+
# fall back to the default locale
711+
locale.setlocale(locale.LC_ALL, "C")
708712

709713
# Try to fix Unicode issues on systems with bad defaults
710714
if _CHANGE_C_LC_CTYPE_TO_UTF8:

0 commit comments

Comments
 (0)