8000 gh-133740: Fix regression in locale.nl_langinfo(ALT_DIGITS) (GH-136237) · miss-islington/cpython@22d2bd5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 22d2bd5

Browse files
serhiy-storchakamiss-islington
authored andcommitted
pythongh-133740: Fix regression in locale.nl_langinfo(ALT_DIGITS) (pythonGH-136237)
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 22d2bd5

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