summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-11-16 00:30:24 +0000
committerZac Medico <zmedico@gentoo.org>2009-11-16 00:30:24 +0000
commit90f45c05a11a3421dd3c01f4304574499aebdb84 (patch)
tree761c146252b79194b2676079a07827db6a47e79c
parentb3df33c444d72a1238e9dc0b2c548a4a67ce92f6 (diff)
downloadportage-90f45c05a11a3421dd3c01f4304574499aebdb84.tar.gz
portage-90f45c05a11a3421dd3c01f4304574499aebdb84.tar.bz2
portage-90f45c05a11a3421dd3c01f4304574499aebdb84.zip
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
-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):