From: Barry Warsaw Date: Wed, 12 Mar 2003 03:14:11 +0000 (+0000) Subject: test_whitespace_eater_unicode(): Make this test Python 2.1 compatible. X-Git-Tag: v2.3c1~1472 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea8f6fa094449a977ae416ab7694e548062bf769;p=thirdparty%2FPython%2Fcpython.git test_whitespace_eater_unicode(): Make this test Python 2.1 compatible. --- diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py index f580f7d5f056..4bc111a215cb 100644 --- a/Lib/email/test/test_email.py +++ b/Lib/email/test/test_email.py @@ -1288,7 +1288,10 @@ class TestRFC2047(unittest.TestCase): s = '=?ISO-8859-1?Q?Andr=E9?= Pirard ' dh = decode_header(s) eq(dh, [('Andr\xe9', 'iso-8859-1'), ('Pirard ', 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 ')