summaryrefslogtreecommitdiff
path: root/menuconfig.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2019-06-15 21:36:43 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2019-06-15 21:36:43 +0200
commit0c79d2332c85123b5f83be8fa06d5ce5cb261f4e (patch)
tree23560df57710bfeec4d2d79c383a567b7762bcb3 /menuconfig.py
parentb9396c0b9053d85bdf3b28a7dc6660825c822354 (diff)
menuconfig: Be silent when changing LC_CTYPE to a UTF-8 locale
Having LC_ALL=C and the like in Makefiles is probably pretty common, to get consistent collation and messages from commands and stuff. It currently makes menuconfig.py spit out a warning about changing the locale to a UTF-8 locale though. Just remove the message, and silently change the locale. The Python 3.7 PEP 538 code is silent as well.
Diffstat (limited to 'menuconfig.py')
-rwxr-xr-xmenuconfig.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/menuconfig.py b/menuconfig.py
index cfcfbef..9525826 100755
--- a/menuconfig.py
+++ b/menuconfig.py
@@ -3245,15 +3245,13 @@ def _convert_c_lc_ctype_to_utf8():
return False
# Is LC_CTYPE set to the C locale?
- if locale.setlocale(locale.LC_CTYPE, None) == "C":
+ if locale.setlocale(locale.LC_CTYPE) == "C":
# This list was taken from the PEP 538 implementation in the CPython
# code, in Python/pylifecycle.c
for loc in "C.UTF-8", "C.utf8", "UTF-8":
if try_set_locale(loc):
- print("Note: Your environment is configured to use ASCII. To "
- "avoid Unicode issues, LC_CTYPE was changed from the "
- "C locale to the {} locale.".format(loc))
- break
+ # LC_CTYPE successfully changed
+ return
# Are we running on Windows?