From 3c85fe07f40a18d9f5733e85b213a6992c5b2ed4 Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Fri, 4 Nov 2011 21:35:07 +0200 Subject: Issue #3067: Fix the error raised by locale.setlocale() --- Lib/test/test_locale.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Lib/test/test_locale.py') diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py index 5d4b5fb420..30480c15b9 100644 --- a/Lib/test/test_locale.py +++ b/Lib/test/test_locale.py @@ -407,6 +407,14 @@ class TestMiscellaneous(unittest.TestCase): locale.setlocale(locale.LC_CTYPE, loc) self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE)) + def test_invalid_locale_format_in_localetuple(self): + with self.assertRaises(TypeError): + locale.setlocale(locale.LC_ALL, b'fi_FI') + + def test_invalid_iterable_in_localetuple(self): + with self.assertRaises(TypeError): + locale.setlocale(locale.LC_ALL, (b'not', b'valid')) + def test_main(): tests = [ -- cgit v1.2.1