]> granicus.if.org Git - python/commitdiff
Closes #16080: The decorator ignores failed attempts to set the required
authorStefan Krah <skrah@bytereef.org>
Fri, 28 Sep 2012 15:17:11 +0000 (17:17 +0200)
committerStefan Krah <skrah@bytereef.org>
Fri, 28 Sep 2012 15:17:11 +0000 (17:17 +0200)
locale, so an additional check is required.

Lib/test/test_decimal.py

index b2ec1a6e07a6073bad932f741a18df13d65b1758..ec5db9fa423ae08cccd72df1a66d07300fc9b620 100644 (file)
@@ -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')