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