Skip to content

Commit e0e15da

Browse files
committed
build: fix line length off by one error
While running the test suite the progress bar shows former line endings if the new line is shorter than the former line. The length was calculated without the line ending. It is now an empty string to prevent the off by one error instead of using extra whitespace. PR-URL: #24748 Refs: #24486 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent 798504a commit e0e15da

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/test.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def PrintProgress(self, name):
423423
}
424424
status = self.Truncate(status, 78)
425425
self.last_status_length = len(status)
426-
print(status, end=' ')
426+
print(status, end='')
427427
sys.stdout.flush()
428428

429429

@@ -438,7 +438,7 @@ def __init__(self, cases, flaky_tests_mode):
438438
super(ColorProgressIndicator, self).__init__(cases, flaky_tests_mode, templates)
439439

440440
def ClearLine(self, last_line_length):
441-
print("\033[1K\r", end=' ')
441+
print("\033[1K\r", end='')
442442

443443

444444
class MonochromeProgressIndicator(CompactProgressIndicator):
@@ -454,7 +454,7 @@ def __init__(self, cases, flaky_tests_mode):
454454
super(MonochromeProgressIndicator, self).__init__(cases, flaky_tests_mode, templates)
455455

456456
def ClearLine(self, last_line_length):
457-
print(("\r" + (" " * last_line_length) + "\r"), end=' ')
457+
print(("\r" + (" " * last_line_length) + "\r"), end='')
458458

459459

460460
PROGRESS_INDICATORS = {

0 commit comments

Comments
 (0)