Commit 04767c65 authored by Nate Case's avatar Nate Case Committed by Jeremy Kerr
Browse files

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: default avatarNate Case <ncase@xes-inc.com>
Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
parent 97d8d152
......@@ -25,8 +25,13 @@ import datetime
import time
import operator
from email import message_from_file
from email.header import Header
from email.utils import parsedate_tz, mktime_tz
try:
from email.header import Header
from email.utils import parsedate_tz, mktime_tz
except ImportError:
# Python 2.4 compatibility
from email.Header import Header
from email.Utils import parsedate_tz, mktime_tz
from patchparser import parse_patch
from patchwork.models import Patch, Project, Person, Comment
......
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment