From: Stefan Krah Date: Fri, 28 Sep 2012 15:17:11 +0000 (+0200) Subject: Closes #16080: The decorator ignores failed attempts to set the required X-Git-Tag: v3.3.1rc1~818^2^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a491a8eef6c2e1997eae1b17ba94cd8c2d1763e;p=python Closes #16080: The decorator ignores failed attempts to set the required locale, so an additional check is required. --- diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index b2ec1a6e07..ec5db9fa42 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -1140,8 +1140,14 @@ class FormatTest(unittest.TestCase): @run_with_locale('LC_ALL', 'ps_AF') def test_wide_char_separator_decimal_point(self): # locale with wide char separator and decimal point + import locale Decimal = self.decimal.Decimal + decimal_point = locale.localeconv()['decimal_point'] + thousands_sep = locale.localeconv()['thousands_sep'] + if decimal_point != '\u066b' or thousands_sep != '\u066c': + return + self.assertEqual(format(Decimal('100000000.123'), 'n'), '100\u066c000\u066c000\u066b123')