Skip to content

Commit 18df99c

Browse files
committed
fix crash caused by unsupported locales
1 parent 061e71f commit 18df99c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

menuconfig.py

+7-2
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)