diff --git a/Lib/string.py b/Lib/string.py index 1953bfc38fc..fd8363b0ec7 100644 --- a/Lib/string.py +++ b/Lib/string.py @@ -287,8 +287,8 @@ def capitalize(s): # Capitalize the words in a string, e.g. " aBc dEf " -> "Abc Def". # See also regsub.capwords(). -def capwords(s): - return join(map(capitalize, split(s))) +def capwords(s, sep=None): + return join(map(capitalize, split(s, sep))) # Construct a translation string _idmapL = None diff --git a/Lib/stringold.py b/Lib/stringold.py index 1953bfc38fc..fd8363b0ec7 100644 --- a/Lib/stringold.py +++ b/Lib/stringold.py @@ -287,8 +287,8 @@ def capitalize(s): # Capitalize the words in a string, e.g. " aBc dEf " -> "Abc Def". # See also regsub.capwords(). -def capwords(s): - return join(map(capitalize, split(s))) +def capwords(s, sep=None): + return join(map(capitalize, split(s, sep))) # Construct a translation string _idmapL = None