mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 12:59:42 -07:00
Fix CustomFormatter for Python 2
This commit is contained in:
parent
5b067bd17d
commit
843a400b2d
1 changed files with 12 additions and 5 deletions
|
@ -1788,10 +1788,14 @@ class CustomFormatter(Formatter):
|
||||||
obj = self.convert_field(obj, conversion)
|
obj = self.convert_field(obj, conversion)
|
||||||
|
|
||||||
# expand the format spec, if needed
|
# expand the format spec, if needed
|
||||||
format_spec, auto_arg_index = self._vformat(
|
if plexpy.PYTHON_VERSION < 3:
|
||||||
format_spec, args, kwargs,
|
format_spec = self._vformat(format_spec, args, kwargs,
|
||||||
used_args, recursion_depth-1,
|
used_args, recursion_depth - 1)
|
||||||
auto_arg_index=auto_arg_index)
|
else:
|
||||||
|
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
|
# format the object and append to the result
|
||||||
formatted_field = self.format_field(obj, format_spec)
|
formatted_field = self.format_field(obj, format_spec)
|
||||||
|
@ -1803,4 +1807,7 @@ class CustomFormatter(Formatter):
|
||||||
result.append(suffix)
|
result.append(suffix)
|
||||||
# result.append(self.format_field(obj, format_spec))
|
# result.append(self.format_field(obj, format_spec))
|
||||||
|
|
||||||
return ''.join(result), auto_arg_index
|
if plexpy.PYTHON_VERSION < 3:
|
||||||
|
return ''.join(result)
|
||||||
|
else:
|
||||||
|
return ''.join(result), auto_arg_index
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue