diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-02-09 09:39:08 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-02-09 09:39:08 +0000 |
commit | a27cf43e685ee85d719214d8e49b92b5279a6179 (patch) | |
tree | 45d9656aa5e1ccbdda8ec47cddfd51106865f821 /Lib/MimeWriter.py | |
parent | 77fb9e7af2aaa8b9955c5527f33381df5147cdeb (diff) | |
download | cpython-a27cf43e685ee85d719214d8e49b92b5279a6179.tar.gz |
String method conversion.
Diffstat (limited to 'Lib/MimeWriter.py')
-rw-r--r-- | Lib/MimeWriter.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/MimeWriter.py b/Lib/MimeWriter.py index 6aab1cd5f1..bb878c1c9d 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) |