summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_locale.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-07-19 12:46:12 (GMT)
committerGeorg Brandl <georg@python.org>2008-07-19 12:46:12 (GMT)
commit278fc50c07fcfb90b681c1401eaa9ed40bb1778c (patch)
tree4d07aeaddee59163b28e59820c8d9700682d324f /Lib/test/test_locale.py
parent6b41a8e156d7c38947a082016ffb58de8d2485ce (diff)
downloadcpython-278fc50c07fcfb90b681c1401eaa9ed40bb1778c.zip
cpython-278fc50c07fcfb90b681c1401eaa9ed40bb1778c.tar.gz
cpython-278fc50c07fcfb90b681c1401eaa9ed40bb1778c.tar.bz2
#3303: fix crash with invalid Py_DECREF in strcoll().
Diffstat (limited to 'Lib/test/test_locale.py')
-rw-r--r--Lib/test/test_locale.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
index a91d358..c67fbfe 100644
--- a/Lib/test/test_locale.py
+++ b/Lib/test/test_locale.py
@@ -1,4 +1,4 @@
-from test.test_support import verbose, TestSkipped
+from test.test_support import verbose, TestSkipped, TestFailed
import locale
import sys
@@ -113,3 +113,12 @@ else:
teststrop('\xed\x95\xa0', 'upper', '\xed\x95\xa0')
finally:
locale.setlocale(locale.LC_CTYPE, oldlocale)
+
+if hasattr(locale, "strcoll"):
+ # test crasher from bug #3303
+ try:
+ locale.strcoll(u"a", None)
+ except TypeError:
+ pass
+ else:
+ raise TestFailed("TypeError not raised")