summaryrefslogtreecommitdiffstats
path: root/Lib/regsub.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-02-09 09:19:27 (GMT)
committerEric S. Raymond <esr@thyrsus.com>2001-02-09 09:19:27 (GMT)
commit66d9919cab903e152d206b7edb853799eca564d0 (patch)
tree02904c744034f367e8be10dc15c8ea7007d8f1d4 /Lib/regsub.py
parentee5e61d3bc127c9d3c6ac752b2d381718da910ef (diff)
downloadcpython-66d9919cab903e152d206b7edb853799eca564d0.zip
cpython-66d9919cab903e152d206b7edb853799eca564d0.tar.gz
cpython-66d9919cab903e152d206b7edb853799eca564d0.tar.bz2
String method conversion.
Diffstat (limited to 'Lib/regsub.py')
-rw-r--r--Lib/regsub.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/regsub.py b/Lib/regsub.py
index 4a36512..7778602 100644
--- a/Lib/regsub.py
+++ b/Lib/regsub.py
@@ -107,11 +107,10 @@ def intsplit(str, pat, maxsplit, retain):
# Capitalize words split using a pattern
def capwords(str, pat='[^a-zA-Z0-9_]+'):
- import string
words = splitx(str, pat)
for i in range(0, len(words), 2):
- words[i] = string.capitalize(words[i])
- return string.joinfields(words, "")
+ words[i] = words[i].capitalize()
+ return "".joinfields(words)
# Internal subroutines: