summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_locale.py
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2011-11-04 20:21:52 (GMT)
committerPetri Lehtinen <petri@digip.org>2011-11-04 20:22:03 (GMT)
commitc9f38462eecc27a6c5be041df4a5910f6a2ab99f (patch)
treed40391e88d32d1d302b7f86c332845725cd92289 /Lib/test/test_locale.py
parente30c0a1014fb8f7978f608d6c7f430842f685075 (diff)
parent3c85fe07f40a18d9f5733e85b213a6992c5b2ed4 (diff)
downloadcpython-c9f38462eecc27a6c5be041df4a5910f6a2ab99f.zip
cpython-c9f38462eecc27a6c5be041df4a5910f6a2ab99f.tar.gz
cpython-c9f38462eecc27a6c5be041df4a5910f6a2ab99f.tar.bz2
Issue #3067: Fix the error raised by locale.setlocale()
Diffstat (limited to 'Lib/test/test_locale.py')
-rw-r--r--Lib/test/test_locale.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
index 19abe59..44081b9 100644
--- a/Lib/test/test_locale.py
+++ b/Lib/test/test_locale.py
@@ -409,6 +409,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 = [