aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-11-11 06:46:12 +0000
committerZac Medico <zmedico@gentoo.org>2009-11-11 06:46:12 +0000
commitf2028ae40f352e0c90c9358d3bb0e072cd9794f0 (patch)
treef0a75655a6fe15e7825fd0a81f137eb01cd8e91e /pym/portage/mail.py
parentBug #292528 - Specify UTF-8 in the MIMEText constructor arguments, in order (diff)
downloadportage-f2028ae40f352e0c90c9358d3bb0e072cd9794f0.tar.gz
portage-f2028ae40f352e0c90c9358d3bb0e072cd9794f0.tar.bz2
portage-f2028ae40f352e0c90c9358d3bb0e072cd9794f0.zip
Preserve previous usage of MIMEText constructor under python2, since it's
known to work this way. svn path=/main/trunk/; revision=14807
Diffstat (limited to 'pym/portage/mail.py')
-rw-r--r--pym/portage/mail.py7
1 files 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):