mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #25034: Merge from 3.4.
This commit is contained in:
commit
ad4003c7fb
4 changed files with 12 additions and 5 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue