From f2028ae40f352e0c90c9358d3bb0e072cd9794f0 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 11 Nov 2009 06:46:12 +0000 Subject: Preserve previous usage of MIMEText constructor under python2, since it's known to work this way. svn path=/main/trunk/; revision=14807 --- 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): -- cgit v1.2.3-1-g7c22