From 90f45c05a11a3421dd3c01f4304574499aebdb84 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 16 Nov 2009 00:30:24 +0000 Subject: [PATCH] Preserve previous usage of MIMEText constructor under python2, since it's known to work this way. (trunk r14807) svn path=/main/branches/2.1.7/; revision=14830 --- pym/portage/mail.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pym/portage/mail.py b/pym/portage/mail.py index 64774cdac..96bb38e83 100644 --- a/pym/portage/mail.py +++ b/pym/portage/mail.py @@ -21,8 +21,11 @@ import portage if sys.hexversion >= 0x3000000: basestring = str -def TextMessage(_text): - return MIMEText(_text, _charset="UTF-8") +if sys.hexversion >= 0x3000000: + def TextMessage(_text): + return MIMEText(_text, _charset="UTF-8") +else: + TextMessage = MIMEText def create_message(sender, recipient, subject, body, attachments=None): -- 2.26.2