8000 [3.14] gh-133740: Fix regression in locale.nl_langinfo(ALT_DIGITS) (G… · python/cpython@150262d · GitHub
[go: up one dir, main page]

Skip to content

Commit 150262d

Browse files
[3.14] gh-133740: Fix regression in locale.nl_langinfo(ALT_DIGITS) (GH-136237) (GH-136240)
There is no need to temporary switch locale for items ALT_DIGITS and ERA if the nl_langinfo() result is empty (most locales). (cherry picked from commit 5c984ae) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 4bc9c01 commit 150262d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_localemodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ _locale_nl_langinfo_impl(PyObject *module, int item)
692692
result = result != NULL ? result : "";
693693
char *oldloc = NULL;
694694
if (langinfo_constants[i].category != LC_CTYPE
695-
&& (
695+
&& *result && (
696696
#ifdef __GLIBC__
697697
// gh-133740: Always change the locale for ALT_DIGITS and ERA
698698
# ifdef ALT_DIGITS

0 commit comments

Comments
 (0)
0