[perf] Use f-string instead of formatting for truncation message
This commit is contained in:
parent
f6adebb990
commit
5c78ef125f
|
@ -62,13 +62,13 @@ def _truncate_explanation(
|
||||||
# Append useful message to explanation
|
# Append useful message to explanation
|
||||||
truncated_line_count = len(input_lines) - len(truncated_explanation)
|
truncated_line_count = len(input_lines) - len(truncated_explanation)
|
||||||
truncated_line_count += 1 # Account for the part-truncated final line
|
truncated_line_count += 1 # Account for the part-truncated final line
|
||||||
msg = "...Full output truncated"
|
truncated_explanation.extend(
|
||||||
if truncated_line_count == 1:
|
[
|
||||||
msg += f" ({truncated_line_count} line hidden)"
|
"", # Line break
|
||||||
else:
|
f"...Full output truncated ({truncated_line_count} line"
|
||||||
msg += f" ({truncated_line_count} lines hidden)"
|
f"{'' if truncated_line_count == 1 else 's'} hidden), {USAGE_MSG}",
|
||||||
msg += f", {USAGE_MSG}"
|
]
|
||||||
truncated_explanation.extend(["", str(msg)])
|
)
|
||||||
return truncated_explanation
|
return truncated_explanation
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue