From 2a20f9be709a805e3af5d9cf5b4fe987b9db7c1c Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Wed, 27 Jul 2011 01:06:07 +0200 Subject: [PATCH] Backport 0398f07d4827 (fix for weird buildbot failures) --- Lib/test/test_codecs.py | 2 +- Lib/test/test_locale.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py index 6b84023d23..4899a59ef2 100644 --- a/Lib/test/test_codecs.py +++ b/Lib/test/test_codecs.py @@ -1234,7 +1234,7 @@ class CodecsModuleTest(unittest.TestCase): def test_lookup_issue1813(self): # Issue #1813: under Turkish locales, lookup of some codecs failed # because 'I' is lowercased as "ı" (dotless i) - oldlocale = locale.getlocale(locale.LC_CTYPE) + oldlocale = locale.setlocale(locale.LC_CTYPE) self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale) try: locale.setlocale(locale.LC_CTYPE, 'tr_TR') diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py index 5155923c91..46e228ef8e 100644 --- a/Lib/test/test_locale.py +++ b/Lib/test/test_locale.py @@ -393,16 +393,16 @@ class TestMiscellaneous(unittest.TestCase): def test_getsetlocale_issue1813(self): # Issue #1813: setting and getting the locale under a Turkish locale - oldlocale = locale.getlocale() + oldlocale = locale.setlocale(locale.LC_CTYPE) self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale) try: locale.setlocale(locale.LC_CTYPE, 'tr_TR') except locale.Error: # Unsupported locale on this system self.skipTest('test needs Turkish locale') - loc = locale.getlocale() + loc = locale.getlocale(locale.LC_CTYPE) locale.setlocale(locale.LC_CTYPE, loc) - self.assertEqual(loc, locale.getlocale()) + self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE)) def test_main(): -- 2.40.0