Skip to content

Commit 79d373d

Browse files
committed
Apply Serhiy's suggestion
1 parent 1c0f20e commit 79d373d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Modules/_localemodule.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,17 @@ _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-
// gh-133740: Always change the locale for ALT_DIGITS
696-
&& (item == ALT_DIGITS || !is_all_ascii(result))
695+
// gh-133740: Always change the locale for ALT_DIGITS and ERA
696+
&& (
697+
#ifdef __GLIBC__
698+
# ifdef ALT_DIGITS
699+
item == ALT_DIGITS ||
700+
# endif
701+
# ifdef ERA
702+
item == ERA ||
703+
# endif
704+
#endif
705+
!is_all_ascii(result))
697706
&& change_locale(langinfo_constants[i].category, &oldloc) < 0)
698707
{
699708
return NULL;

0 commit comments

Comments
 (0)