Skip to content

Commit

Permalink
fix divide by 0 errors in --verbose output of progress tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Rainchus committed Sep 18, 2024
1 parent ed199a0 commit ffa1217
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1406,9 +1406,13 @@ def add(self, build_obj: Dict[str, Any]) -> None:
self.objects_progress += 1

def code_frac(self) -> float:
if self.code_total == 0:
return 1.0
return self.code_progress / self.code_total

def data_frac(self) -> float:
if self.data_total == 0:
return 1.0
return self.data_progress / self.data_total

progress_units: Dict[str, ProgressUnit] = {}
Expand Down

0 comments on commit ffa1217

Please sign in to comment.