summaryrefslogtreecommitdiffstats
path: root/apps/patchwork/models.py
diff options
context:
space:
mode:
authorNate Case <ncase@xes-inc.com>2008-08-22 15:58:03 -0500
committerJeremy Kerr <jk@ozlabs.org>2008-08-23 10:51:34 +0800
commit04767c65175f2a76127cd78649c5d92a82a39bb6 (patch)
tree31aef3f00156a0bf31bf935bef0986669197dcc1 /apps/patchwork/models.py
parent97d8d152a5f832f6266a33622e25f4ae5f7dc068 (diff)
downloadpatchwork-04767c65175f2a76127cd78649c5d92a82a39bb6.tar.bz2
patchwork-04767c65175f2a76127cd78649c5d92a82a39bb6.tar.xz
Add support for Python 2.4 email modules
Use email.MIMEText, email.Utils, and email.Header in the case where importing the newer email.mime.text, email.utils, and email.header modules failed. Signed-off-by: Nate Case <ncase@xes-inc.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'apps/patchwork/models.py')
-rw-r--r--apps/patchwork/models.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/patchwork/models.py b/apps/patchwork/models.py
index eef4b69..d8a9b3f 100644
--- a/apps/patchwork/models.py
+++ b/apps/patchwork/models.py
@@ -28,8 +28,15 @@ import re
import datetime, time
import string
import random
-from email.mime.text import MIMEText
-import email.utils
+
+try:
+ from email.mime.text import MIMEText
+ import email.utils
+except ImportError:
+ # Python 2.4 compatibility
+ from email.MIMEText import MIMEText
+ import email.Utils
+ email.utils = email.Utils
class Person(models.Model):
email = models.CharField(max_length=255, unique = True)