diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-17 07:27:56 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-01-17 07:27:56 (GMT) |
commit | af080876dc4148b15bb79886b8aeecbf173f4fd3 (patch) | |
tree | 9a75d0e9c4f24f584033d4782ee810a311d14f76 /Lib/test | |
parent | 8363f77795503e5352d983be844f156f4f495458 (diff) | |
download | cpython-af080876dc4148b15bb79886b8aeecbf173f4fd3.zip cpython-af080876dc4148b15bb79886b8aeecbf173f4fd3.tar.gz cpython-af080876dc4148b15bb79886b8aeecbf173f4fd3.tar.bz2 |
Issue #20086: Restored the use of locale-independing mapping instead of
locale-depending str.lower() in locale.normalize().
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_locale.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py index d955fa8..cd4d46d 100644 --- a/Lib/test/test_locale.py +++ b/Lib/test/test_locale.py @@ -471,9 +471,13 @@ class TestMiscellaneous(unittest.TestCase): # Issue #1813: setting and getting the locale under a Turkish locale oldlocale = locale.getlocale() self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale) - try: - locale.setlocale(locale.LC_CTYPE, 'tr_TR') - except locale.Error: + for loc in ('tr_TR', 'tr_TR.UTF-8', 'tr_TR.ISO8859-9'): + try: + locale.setlocale(locale.LC_CTYPE, loc) + break + except locale.Error: + continue + else: # Unsupported locale on this system self.skipTest('test needs Turkish locale') loc = locale.getlocale() @@ -482,7 +486,6 @@ class TestMiscellaneous(unittest.TestCase): except Exception as e: self.fail("Failed to set locale %r (default locale is %r): %r" % (loc, oldlocale, e)) - print("set locale %r (default locale is %r)" % (loc, oldlocale)) self.assertEqual(loc, locale.getlocale()) def test_normalize_issue12752(self): |