diff options
author | Walter Dörwald <walter@livinglogic.de> | 2004-02-05 17:36:00 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2004-02-05 17:36:00 (GMT) |
commit | cd736e71a3d35d870c2ff89b90a39050553a2453 (patch) | |
tree | 7b166e3128b1ae6187a30f2405abe3220d14f265 /Lib | |
parent | bc875f5a36b744c1a7263c35befaf31208a416b1 (diff) | |
download | cpython-cd736e71a3d35d870c2ff89b90a39050553a2453.zip cpython-cd736e71a3d35d870c2ff89b90a39050553a2453.tar.gz cpython-cd736e71a3d35d870c2ff89b90a39050553a2453.tar.bz2 |
Fix reallocation bug in unicode.translate(): The code was comparing
characters instead of character pointers to determine space requirements.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_unicode.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 18a2d46..5ce2842 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -136,6 +136,7 @@ class UnicodeTest( self.checkequalnofix(u'iiix', u'abababc', 'translate', {ord('a'):None, ord('b'):ord('i'), ord('c'):u'x'}) self.checkequalnofix(u'<i><i><i>c', u'abababc', 'translate', {ord('a'):None, ord('b'):u'<i>'}) self.checkequalnofix(u'c', u'abababc', 'translate', {ord('a'):None, ord('b'):u''}) + self.checkequalnofix(u'xyyx', u'xzx', 'translate', {ord('z'):u'yy'}) self.assertRaises(TypeError, u'hello'.translate) self.assertRaises(TypeError, u'abababc'.translate, {ord('a'):''}) |