From: Zac Medico Date: Wed, 11 Nov 2009 06:46:12 +0000 (-0000) Subject: Preserve previous usage of MIMEText constructor under python2, since it's X-Git-Tag: v2.2_rc50~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f2028ae40f352e0c90c9358d3bb0e072cd9794f0;p=portage.git Preserve previous usage of MIMEText constructor under python2, since it's known to work this way. svn path=/main/trunk/; revision=14807 --- 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):