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

Skip to content

Commit 5c984ae

Browse files
gh-133740: Fix regression in locale.nl_langinfo(ALT_DIGITS) (GH-136237)
There is no need to temporary switch locale for items ALT_DIGITS and ERA if the nl_langinfo() result is empty (most locales).
1 parent 8dc3383 commit 5c984ae

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