[Python-checkins] cpython: Closes #16080: The decorator ignores failed attempts to set the required

stefan.krah python-checkins at python.org
Fri Sep 28 17:25:18 CEST 2012


http://hg.python.org/cpython/rev/f1094697d7dc
changeset:   79221:f1094697d7dc
user:        Stefan Krah <skrah at bytereef.org>
date:        Fri Sep 28 17:17:11 2012 +0200
summary:
  Closes #16080: The decorator ignores failed attempts to set the required
locale, so an additional check is required.

files:
  Lib/test/test_decimal.py |  6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -1140,8 +1140,14 @@
     @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')
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list