Skip to content

Commit 1aa1bc0

Browse files
committed
[CHERRY-PICK] DebugMacroCheck: Do not show progress bar with zero items
In the case that the total provided to the `_show_progress()` function is zero, do not show a progress bar to prevent aborts `ZeroDivisionError` when calculating the progress percentage. Signed-off-by: Michael Kubacki <[email protected]> (cherry picked from commit 67df979)
1 parent f82d14c commit 1aa1bc0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

BaseTools/Plugin/DebugMacroCheck/DebugMacroCheck.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,9 @@ def _show_progress(step: int, total: int, suffix: str = '') -> None:
577577
"""
578578
global _progress_start_time
579579

580+
if total == 0:
581+
return
582+
580583
if step == 0:
581584
_progress_start_time = timeit.default_timer()
582585

0 commit comments

Comments
 (0)