File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ def _truncate_explanation(
6767 because _get_truncation_parameters was called first.
6868 """
6969 # Check if truncation required
70- input_char_count = len ("" . join ( input_lines ) )
70+ input_char_count = sum ( len (line ) for line in input_lines )
7171 # The length of the truncation explanation depends on the number of lines
7272 # removed but is at least 68 characters:
7373 # The real value is
@@ -96,7 +96,8 @@ def _truncate_explanation(
9696 truncated_explanation = input_lines
9797 # We reevaluate the need to truncate chars following removal of some lines
9898 need_to_truncate_char = (
99- max_chars > 0 and len ("" .join (truncated_explanation )) > tolerable_max_chars
99+ max_chars > 0
100+ and sum (len (e ) for e in truncated_explanation ) > tolerable_max_chars
100101 )
101102 if need_to_truncate_char :
102103 truncated_explanation = _truncate_by_char_count (
You can’t perform that action at this time.
0 commit comments