summaryrefslogtreecommitdiffstats
path: root/Lib/email/header.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-02 19:09:54 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-02 19:09:54 (GMT)
commitef87d6ed94780fe00250a551031023aeb2898365 (patch)
tree1f8989aaaec7ec5f8b2f26498317f2022bf85531 /Lib/email/header.py
parent572dbf8f1320c0b34b9c786e5c30ba4a4b61b292 (diff)
downloadcpython-ef87d6ed94780fe00250a551031023aeb2898365.zip
cpython-ef87d6ed94780fe00250a551031023aeb2898365.tar.gz
cpython-ef87d6ed94780fe00250a551031023aeb2898365.tar.bz2
Rip out all the u"..." literals and calls to unicode().
Diffstat (limited to 'Lib/email/header.py')
-rw-r--r--Lib/email/header.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/email/header.py b/Lib/email/header.py
index ab0d3fc..675b68d 100644
--- a/Lib/email/header.py
+++ b/Lib/email/header.py
@@ -21,9 +21,9 @@ from email.charset import Charset
NL = '\n'
SPACE = ' '
-USPACE = u' '
+USPACE = ' '
SPACE8 = ' ' * 8
-UEMPTYSTRING = u''
+UEMPTYSTRING = ''
MAXLINELEN = 76
@@ -210,7 +210,7 @@ class Header:
elif nextcs not in (None, 'us-ascii'):
uchunks.append(USPACE)
lastcs = nextcs
- uchunks.append(unicode(s, str(charset)))
+ uchunks.append(str(s, str(charset)))
return UEMPTYSTRING.join(uchunks)
# Rich comparison operators for equality only. BAW: does it make sense to
@@ -257,13 +257,13 @@ class Header:
# 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'
- ustr = unicode(s, incodec, errors)
+ ustr = str(s, incodec, errors)
# Now make sure that the unicode could be converted back to a
# byte string with the output codec, which may be different
# than the iput coded. Still, use the original byte string.
outcodec = charset.output_codec or 'us-ascii'
ustr.encode(outcodec, errors)
- elif isinstance(s, unicode):
+ elif isinstance(s, str):
# 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.