summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-02-09 16:56:44 (GMT)
committerEric S. Raymond <esr@thyrsus.com>2001-02-09 16:56:44 (GMT)
commite37340edf21f207659d1b2dcccf354c1bd46d4b0 (patch)
tree223df208b57ca8ff35227db5fde877327b6e0fa9
parentdcd3a875a57f5cc616e96f7c4848b3e32143b4d3 (diff)
downloadcpython-e37340edf21f207659d1b2dcccf354c1bd46d4b0.zip
cpython-e37340edf21f207659d1b2dcccf354c1bd46d4b0.tar.gz
cpython-e37340edf21f207659d1b2dcccf354c1bd46d4b0.tar.bz2
String method conversion.
-rw-r--r--Lib/multifile.py8
-rw-r--r--Lib/string.py2
-rw-r--r--Lib/stringold.py2
3 files changed, 4 insertions, 8 deletions
diff --git a/Lib/multifile.py b/Lib/multifile.py
index e0305d8..60a4303 100644
--- a/Lib/multifile.py
+++ b/Lib/multifile.py
@@ -28,7 +28,6 @@ seekable stream object.
"""
import sys
-import string
__all__ = ["MultiFile","Error"]
@@ -88,10 +87,7 @@ class MultiFile:
return line
else:
# Ignore trailing whitespace on marker lines
- k = len(line) - 1
- while line[k] in string.whitespace:
- k = k - 1
- marker = line[:k+1]
+ marker = line.rstrip()
# No? OK, try to match a boundary.
# Return the line (unstripped) if we don't.
for i in range(len(self.stack)):
@@ -121,7 +117,7 @@ class MultiFile:
return list
def read(self): # Note: no size argument -- read until EOF only!
- return string.joinfields(self.readlines(), '')
+ return self.readlines().join('')
def next(self):
while self.readline(): pass
diff --git a/Lib/string.py b/Lib/string.py
index 61b253e..bdd9254 100644
--- a/Lib/string.py
+++ b/Lib/string.py
@@ -356,7 +356,7 @@ def maketrans(fromstr, tostr):
fromstr = map(ord, fromstr)
for i in range(len(fromstr)):
L[fromstr[i]] = tostr[i]
- return joinfields(L, "")
+ return join(L, "")
# Substring replacement (global)
def replace(s, old, new, maxsplit=-1):
diff --git a/Lib/stringold.py b/Lib/stringold.py
index c3e6f6f..dcc1143 100644
--- a/Lib/stringold.py
+++ b/Lib/stringold.py
@@ -395,7 +395,7 @@ def maketrans(fromstr, tostr):
fromstr = map(ord, fromstr)
for i in range(len(fromstr)):
L[fromstr[i]] = tostr[i]
- return joinfields(L, "")
+ return join(L, "")
# Substring replacement (global)
def replace(s, old, new, maxsplit=0):