summaryrefslogtreecommitdiffstats
path: root/Lib/MimeWriter.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-02-09 09:39:08 (GMT)
committerEric S. Raymond <esr@thyrsus.com>2001-02-09 09:39:08 (GMT)
commitec3bbdef94703b7a69dcc758a4059046bc4d79f0 (patch)
treeaa8a7040f69dc49f113b704c520bedfbb9ed7a8a /Lib/MimeWriter.py
parent92852ad9a44183599a98c135e016e66660a91f13 (diff)
downloadcpython-ec3bbdef94703b7a69dcc758a4059046bc4d79f0.zip
cpython-ec3bbdef94703b7a69dcc758a4059046bc4d79f0.tar.gz
cpython-ec3bbdef94703b7a69dcc758a4059046bc4d79f0.tar.bz2
String method conversion.
Diffstat (limited to 'Lib/MimeWriter.py')
-rw-r--r--Lib/MimeWriter.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/MimeWriter.py b/Lib/MimeWriter.py
index 6aab1cd..bb878c1 100644
--- a/Lib/MimeWriter.py
+++ b/Lib/MimeWriter.py
@@ -7,7 +7,6 @@ MimeWriter - the only thing here.
"""
-import string
import mimetools
__all__ = ["MimeWriter"]
@@ -87,12 +86,12 @@ class MimeWriter:
self._headers = []
def addheader(self, key, value, prefix=0):
- lines = string.splitfields(value, "\n")
+ lines = value.split("\n")
while lines and not lines[-1]: del lines[-1]
while lines and not lines[0]: del lines[0]
for i in range(1, len(lines)):
- lines[i] = " " + string.strip(lines[i])
- value = string.joinfields(lines, "\n") + "\n"
+ lines[i] = " " + lines[i].strip()
+ value = "\n".join(lines) + "\n"
line = key + ": " + value
if prefix:
self._headers.insert(0, line)