diff options
author | Eric V. Smith <eric@trueblade.com> | 2015-09-29 14:30:47 (GMT) |
---|---|---|
committer | Eric V. Smith <eric@trueblade.com> | 2015-09-29 14:30:47 (GMT) |
commit | 6dcada3bcfbaa35930a55bf67e5d6393f444f68a (patch) | |
tree | 729ab8053604716c5323b138a1cf824a4d888714 /Lib/string.py | |
parent | 2fbcd2a057bb09c385d90386e4c17038360b0611 (diff) | |
parent | ad4003c7fb9072c2697480ee84440408f7a49cd9 (diff) | |
download | cpython-6dcada3bcfbaa35930a55bf67e5d6393f444f68a.zip cpython-6dcada3bcfbaa35930a55bf67e5d6393f444f68a.tar.gz cpython-6dcada3bcfbaa35930a55bf67e5d6393f444f68a.tar.bz2 |
Issue #25034: Merge from 3.5.
Diffstat (limited to 'Lib/string.py')
-rw-r--r-- | Lib/string.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/string.py b/Lib/string.py index e7b692d..1add44b 100644 --- a/Lib/string.py +++ b/Lib/string.py @@ -183,7 +183,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 @@ -230,14 +230,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): |