mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
test_whitespace_eater_unicode(): Make this test Python 2.1 compatible.
This commit is contained in:
parent
ca53c12c8b
commit
ea8f6fa094
1 changed files with 4 additions and 1 deletions
|
|
@ -1288,7 +1288,10 @@ def test_whitespace_eater_unicode(self):
|
|||
s = '=?ISO-8859-1?Q?Andr=E9?= Pirard <pirard@dom.ain>'
|
||||
dh = decode_header(s)
|
||||
eq(dh, [('Andr\xe9', 'iso-8859-1'), ('Pirard <pirard@dom.ain>', None)])
|
||||
hu = unicode(make_header(dh)).encode('latin-1')
|
||||
# Python 2.1's unicode() builtin doesn't call the object's
|
||||
# __unicode__() method. Use the following alternative instead.
|
||||
#hu = unicode(make_header(dh)).encode('latin-1')
|
||||
hu = make_header(dh).__unicode__().encode('latin-1')
|
||||
eq(hu, 'Andr\xe9 Pirard <pirard@dom.ain>')
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue