From: Zac Medico Date: Mon, 16 Nov 2009 00:30:24 +0000 (-0000) Subject: Preserve previous usage of MIMEText constructor under python2, since it's X-Git-Tag: v2.1.7.5~11 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=90f45c05a11a3421dd3c01f4304574499aebdb84;p=portage.git 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 --- 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):