[pypy-svn] r73215 - pypy/trunk/pypy/module/_locale/test

getxsick at codespeak.net getxsick at codespeak.net
Wed Mar 31 16:36:24 CEST 2010


Author: getxsick
Date: Wed Mar 31 16:36:23 2010
New Revision: 73215

Modified:
   pypy/trunk/pypy/module/_locale/test/test_locale.py
Log:
avoid to skip the tests on only UTF-8 oriented systems

Modified: pypy/trunk/pypy/module/_locale/test/test_locale.py
==============================================================================
--- pypy/trunk/pypy/module/_locale/test/test_locale.py	(original)
+++ pypy/trunk/pypy/module/_locale/test/test_locale.py	Wed Mar 31 16:36:23 2010
@@ -22,8 +22,15 @@
         current = _locale.setlocale(_locale.LC_ALL)
         try:
             try:
-                _locale.setlocale(_locale.LC_ALL,
-                                  space.str_w(cls.w_language_en))
+                # some systems are only UTF-8 oriented
+                try:
+                    _locale.setlocale(_locale.LC_ALL,
+                                      space.str_w(cls.w_language_en))
+                except _locale.Error:
+                    _locale.setlocale(_locale.LC_ALL,
+                                      space.str_w(cls.w_language_utf8))
+                    cls.w_language_en = cls.w_language_utf8
+
                 _locale.setlocale(_locale.LC_ALL,
                                   space.str_w(cls.w_language_pl))
             except _locale.Error:
@@ -111,10 +118,11 @@
         assert string.lowercase == lcase
         assert string.uppercase == ucase
 
-        _locale.setlocale(_locale.LC_ALL, self.language_en)
+        if self.language_en != self.language_utf8:
+            _locale.setlocale(_locale.LC_ALL, self.language_en)
 
-        assert string.lowercase != lcase
-        assert string.uppercase != ucase
+            assert string.lowercase != lcase
+            assert string.uppercase != ucase
 
     def test_localeconv(self):
         import _locale



More information about the Pypy-commit mailing list