diff options
Diffstat (limited to 'Lib/email/message.py')
-rw-r--r-- | Lib/email/message.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/email/message.py b/Lib/email/message.py index 6fc3af1..1767bfb 100644 --- a/Lib/email/message.py +++ b/Lib/email/message.py @@ -751,13 +751,13 @@ class Message: # LookupError will be raised if the charset isn't known to # Python. UnicodeError will be raised if the encoded text # contains a character not in the charset. - charset = unicode(charset[2], pcharset).encode('us-ascii') + charset = str(charset[2], pcharset).encode('us-ascii') except (LookupError, UnicodeError): charset = charset[2] # charset character must be in us-ascii range try: if isinstance(charset, str): - charset = unicode(charset, 'us-ascii') + charset = str(charset, 'us-ascii') charset = charset.encode('us-ascii') except UnicodeError: return failobj |