Fix Import problem on python2
This commit is contained in:
parent
c725afc3a8
commit
a752e62963
|
@ -14,15 +14,16 @@ import traceback
|
||||||
import re
|
import re
|
||||||
import unicodedata
|
import unicodedata
|
||||||
try:
|
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 StringIO import StringIO
|
||||||
from email.MIMEBase import MIMEBase
|
from email.MIMEBase import MIMEBase
|
||||||
from email.MIMEMultipart import MIMEMultipart
|
from email.MIMEMultipart import MIMEMultipart
|
||||||
from email.MIMEText import MIMEText
|
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 import encoders
|
||||||
from email.generator import Generator
|
from email.generator import Generator
|
||||||
from email.utils import formatdate
|
from email.utils import formatdate
|
||||||
|
|
Loading…
Reference in New Issue
Block a user