summaryrefslogtreecommitdiff
path: root/Lib/email/mime/text.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/email/mime/text.py')
-rw-r--r--Lib/email/mime/text.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/email/mime/text.py b/Lib/email/mime/text.py
index ec18b8594d..479928ec94 100644
--- a/Lib/email/mime/text.py
+++ b/Lib/email/mime/text.py
@@ -6,6 +6,7 @@
__all__ = ['MIMEText']
+from email.charset import Charset
from email.mime.nonmultipart import MIMENonMultipart
@@ -34,6 +35,8 @@ class MIMEText(MIMENonMultipart):
_charset = 'us-ascii'
except UnicodeEncodeError:
_charset = 'utf-8'
+ if isinstance(_charset, Charset):
+ _charset = str(_charset)
MIMENonMultipart.__init__(self, 'text', _subtype,
**{'charset': _charset})