Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8a491a8

Browse files
author
Stefan Krah
committed
Closes #16080: The decorator ignores failed attempts to set the required
locale, so an additional check is required.
1 parent 8ec31c2 commit 8a491a8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Lib/test/test_decimal.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,8 +1140,14 @@ def get_fmt(x, override=None, fmt='n'):
11401140
@run_with_locale('LC_ALL', 'ps_AF')
11411141
def test_wide_char_separator_decimal_point(self):
11421142
# locale with wide char separator and decimal point
1143+
import locale
11431144
Decimal = self.decimal.Decimal
11441145

1146+
decimal_point = locale.localeconv()['decimal_point']
1147+
thousands_sep = locale.localeconv()['thousands_sep']
1148+
if decimal_point != '\u066b' or thousands_sep != '\u066c':
1149+
return
1150+
11451151
self.assertEqual(format(Decimal('100000000.123'), 'n'),
11461152
'100\u066c000\u066c000\u066b123')
11471153

0 commit comments

Comments
 (0)