Fix CustomFormatter for Python 2
This commit is contained in:
@@ -1788,6 +1788,10 @@ 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
|
||||||
|
if plexpy.PYTHON_VERSION < 3:
|
||||||
|
format_spec = self._vformat(format_spec, args, kwargs,
|
||||||
|
used_args, recursion_depth - 1)
|
||||||
|
else:
|
||||||
format_spec, auto_arg_index = self._vformat(
|
format_spec, auto_arg_index = self._vformat(
|
||||||
format_spec, args, kwargs,
|
format_spec, args, kwargs,
|
||||||
used_args, recursion_depth-1,
|
used_args, recursion_depth-1,
|
||||||
@@ -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))
|
||||||
|
|
||||||
|
if plexpy.PYTHON_VERSION < 3:
|
||||||
|
return ''.join(result)
|
||||||
|
else:
|
||||||
return ''.join(result), auto_arg_index
|
return ''.join(result), auto_arg_index
|
||||||
|
Reference in New Issue
Block a user