Merge pull request #3671 from bobhy/pr_3658_v2

Fix regression with LC_MESSAGES, don't add to environment unconditionally [no news article needed].
This commit is contained in:
Morten Enemark Lund 2020-08-10 08:17:05 +02:00 committed by GitHub
commit 70150ddc74
Failed to generate hash of commit

View file

@ -677,7 +677,7 @@ Var.__new__.__defaults__ = (
# Please keep the following in alphabetic order - scopatz
@lazyobject
def DEFAULT_VARS():
return {
dv = {
"ANSICON": Var(
is_string,
ensure_string,
@ -986,14 +986,6 @@ def DEFAULT_VARS():
ensure_string,
locale.setlocale(locale.LC_CTYPE),
),
"LC_MESSAGES": Var(
always_false,
locale_convert("LC_MESSAGES"),
ensure_string,
locale.setlocale(locale.LC_MESSAGES)
if hasattr(locale, "LC_MESSAGES")
else "",
),
"LC_MONETARY": Var(
always_false,
locale_convert("LC_MONETARY"),
@ -1676,6 +1668,16 @@ def DEFAULT_VARS():
),
}
if hasattr(locale, "LC_MESSAGES"):
dv["LC_MESSAGES"] = Var(
always_false,
locale_convert("LC_MESSAGES"),
ensure_string,
locale.setlocale(locale.LC_MESSAGES),
)
return dv
#
# actual environment