From a752e629637818b12a12afcba1ebdcc76b32b3cf Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Tue, 7 Mar 2017 21:08:28 +0100 Subject: [PATCH] Fix Import problem on python2 --- cps/helper.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cps/helper.py b/cps/helper.py index 3430de97..299fb962 100755 --- a/cps/helper.py +++ b/cps/helper.py @@ -14,15 +14,16 @@ import traceback import re import unicodedata try: - from io import StringIO - from email.mime.base import MIMEBase - from email.mime.multipart import MIMEMultipart - from email.mime.text import MIMEText -except ImportError as e: from StringIO import StringIO from email.MIMEBase import MIMEBase from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText +except ImportError as e: + from io import StringIO + from email.mime.base import MIMEBase + from email.mime.multipart import MIMEMultipart + from email.mime.text import MIMEText + from email import encoders from email.generator import Generator from email.utils import formatdate