]> git.openstreetmap.org Git - osqa.git/commitdiff
Wrap email imports for python 2.4 compatibility.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 15 Jun 2010 16:13:35 +0000 (16:13 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 15 Jun 2010 16:13:35 +0000 (16:13 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@421 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/utils/mail.py

index 8f6ee50226d19481d6a6ab37931efa5132fbf89d..0d281c234c626c5ce4fc9c0cef757a38965a2b6b 100644 (file)
@@ -2,11 +2,16 @@ import email
 import socket
 import os
 
-from email.mime.multipart import MIMEMultipart
-from email.mime.text import MIMEText
-from email.mime.image import MIMEImage
-from email.header import Header
-import email.Charset
+try:
+    from email.mime.multipart import MIMEMultipart
+    from email.mime.text import MIMEText
+    from email.mime.image import MIMEImage
+    from email.header import Header
+except:
+    from email.MIMEMultipart import MIMEMultipart
+    from email.MIMEText import MIMEText
+    from email.MIMEImage import MIMEImage
+    from email.Header import Header
 
 from django.core.mail import DNS_NAME
 from smtplib import SMTP