mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix reallocation bug in unicode.translate(): The code was comparing
characters instead of character pointers to determine space requirements.
This commit is contained in:
parent
bc875f5a36
commit
cd736e71a3
2 changed files with 2 additions and 1 deletions
|
@ -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'):''})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue