summaryrefslogtreecommitdiffstats
path: root/Lib/email/header.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-21 00:21:26 (GMT)
committerGuido van Rossum <guido@python.org>2007-07-21 00:21:26 (GMT)
commitd4eda825c7ed83822868e2e6d794e2ad4dc6c955 (patch)
tree3e66eeefe7aed19451a9483d93ac427019ab3a79 /Lib/email/header.py
parentbf4806bac5697bd50e6ca41fcf6838f93ed9a511 (diff)
downloadcpython-d4eda825c7ed83822868e2e6d794e2ad4dc6c955.zip
cpython-d4eda825c7ed83822868e2e6d794e2ad4dc6c955.tar.gz
cpython-d4eda825c7ed83822868e2e6d794e2ad4dc6c955.tar.bz2
SF patch# 1757839 by Alexandre Vassalotti -- make test_mailbox and
test_old_mailbox pass.
Diffstat (limited to 'Lib/email/header.py')
-rw-r--r--Lib/email/header.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/email/header.py b/Lib/email/header.py
index 675b68d..5ea1871 100644
--- a/Lib/email/header.py
+++ b/Lib/email/header.py
@@ -253,7 +253,7 @@ class Header:
# We need to test that the string can be converted to unicode and
# back to a byte string, given the input and output codecs of the
# charset.
- if isinstance(s, str):
+ if isinstance(s, bytes):
# Possibly raise UnicodeError if the byte string can't be
# converted to a unicode with the input codec of the charset.
incodec = charset.input_codec or 'us-ascii'
@@ -263,7 +263,7 @@ class Header:
# than the iput coded. Still, use the original byte string.
outcodec = charset.output_codec or 'us-ascii'
ustr.encode(outcodec, errors)
- elif isinstance(s, str):
+ elif isinstance(s, bytes):
# Now we have to be sure the unicode string can be converted
# to a byte string with a reasonable output codec. We want to
# use the byte string in the chunk.