diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2009-12-01 22:03:44 +0000 |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2009-12-01 22:03:44 +0000 |
commit | 6416034fe3376f614e4b58c87e5b1b27729f014a (patch) | |
tree | c7361b564929c8b2858144b0f2eb2fe43dbe8b81 /Lib/test/test_locale.py | |
parent | f645d9f6f816b71bf8cfa09890ea758d671ddcbd (diff) | |
download | cpython-6416034fe3376f614e4b58c87e5b1b27729f014a.tar.gz |
Merged revisions 76626 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r76626 | amaury.forgeotdarc | 2009-12-01 22:59:18 +0100 (mar., 01 déc. 2009) | 10 lines
Merged revisions 76625 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r76625 | amaury.forgeotdarc | 2009-12-01 22:51:04 +0100 (mar., 01 déc. 2009) | 3 lines
#7419: Fix a crash on Windows in locale.setlocale() when the category
is outside the allowed range.
........
................
Diffstat (limited to 'Lib/test/test_locale.py')
-rw-r--r-- | Lib/test/test_locale.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py index 8dfaf9052d..8c17f8770c 100644 --- a/Lib/test/test_locale.py +++ b/Lib/test/test_locale.py @@ -353,6 +353,17 @@ class TestMiscellaneous(unittest.TestCase): self.assertRaises(TypeError, locale.strcoll, "a", None) self.assertRaises(TypeError, locale.strcoll, b"a", None) + def test_setlocale_category(self): + locale.setlocale(locale.LC_ALL) + locale.setlocale(locale.LC_TIME) + locale.setlocale(locale.LC_CTYPE) + locale.setlocale(locale.LC_COLLATE) + locale.setlocale(locale.LC_MONETARY) + locale.setlocale(locale.LC_NUMERIC) + + # crasher from bug #7419 + self.assertRaises(locale.Error, locale.setlocale, 12345) + def test_main(): tests = [ |