Skip to content

Commit 23b7e61

Browse files
Iksasjserv
authored andcommitted
Fix crash caused by unsupported locales
Signed-off-by: Jim Huang <[email protected]>
1 parent 1688df3 commit 23b7e61

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

menuconfig.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,13 @@ 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+
707+
try:
708+
# Make curses use the locale settings specified in the environment
709+
locale.setlocale(locale.LC_ALL, "")
710+
except locale.Error:
711+
# fall back to the default locale
712+
locale.setlocale(locale.LC_ALL, "C")
708713

709714
# Try to fix Unicode issues on systems with bad defaults
710715
if _CHANGE_C_LC_CTYPE_TO_UTF8:

0 commit comments

Comments
 (0)