From 879fb96afacc61db29a71aa07db4f94d1cc43253 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Wed, 12 Mar 2003 03:14:11 +0000 Subject: [PATCH] test_whitespace_eater_unicode(): Make this test Python 2.1 compatible. git-svn-id: http://svn.python.org/projects/python/trunk@31843 6015fed2-1504-0410-9fe1-9d1591cc4771 --- Lib/email/test/test_email.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py index f580f7d5f0..4bc111a215 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 ') -- 2.11.4.GIT