From b1a0ad007966898c305f4823c590a3e808095e9a Mon Sep 17 00:00:00 2001 From: Ramiro Morales Date: Mon, 28 Feb 2011 14:07:59 +0000 Subject: [PATCH] Fixed #15520 -- Fixed incompatibility with email module shipped with Python 2.4 introduced in r15669. Thanks dobcey for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15675 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/mail/message.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/django/core/mail/message.py b/django/core/mail/message.py index bed4966ef9..01bb1d62d1 100644 --- a/django/core/mail/message.py +++ b/django/core/mail/message.py @@ -3,7 +3,10 @@ import os import random import time from email import Charset, Encoders -from email.generator import Generator +try: + from email.generator import Generator +except ImportError: + from email.Generator import Generator # TODO: Remove when remove Python 2.4 support from email.MIMEText import MIMEText from email.MIMEMultipart import MIMEMultipart from email.MIMEBase import MIMEBase