summaryrefslogtreecommitdiffstats
path: root/Lib/string.py
diff options
context:
space:
mode:
authorEric V. Smith <eric@trueblade.com>2015-09-29 14:30:04 (GMT)
committerEric V. Smith <eric@trueblade.com>2015-09-29 14:30:04 (GMT)
commitad4003c7fb9072c2697480ee84440408f7a49cd9 (patch)
treed0b40b8cae2b95150fcbff61acab9fad0d437e7c /Lib/string.py
parentcb764960c917ba9b91cb7dc3aebf4b642f62167d (diff)
parent85976b14ddb941670ee831ed18b5bc69ca1380ac (diff)
downloadcpython-ad4003c7fb9072c2697480ee84440408f7a49cd9.zip
cpython-ad4003c7fb9072c2697480ee84440408f7a49cd9.tar.gz
cpython-ad4003c7fb9072c2697480ee84440408f7a49cd9.tar.bz2
Issue #25034: Merge from 3.4.
Diffstat (limited to 'Lib/string.py')
-rw-r--r--Lib/string.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/string.py b/Lib/string.py
index f3365c6..62e8f2f 100644
--- a/Lib/string.py
+++ b/Lib/string.py
@@ -188,7 +188,7 @@ class Formatter:
def vformat(self, format_string, args, kwargs):
used_args = set()
- result = self._vformat(format_string, args, kwargs, used_args, 2)
+ result, _ = self._vformat(format_string, args, kwargs, used_args, 2)
self.check_unused_args(used_args, args, kwargs)
return result
@@ -235,14 +235,15 @@ class Formatter:
obj = self.convert_field(obj, conversion)
# expand the format spec, if needed
- format_spec = self._vformat(format_spec, args, kwargs,
- used_args, recursion_depth-1,
- auto_arg_index=auto_arg_index)
+ format_spec, auto_arg_index = self._vformat(
+ format_spec, args, kwargs,
+ used_args, recursion_depth-1,
+ auto_arg_index=auto_arg_index)
# format the object and append to the result
result.append(self.format_field(obj, format_spec))
- return ''.join(result)
+ return ''.join(result), auto_arg_index
def get_value(self, key, args, kwargs):