From ffa12177c14567cac3201967d55ee8274c0aff65 Mon Sep 17 00:00:00 2001 From: Rainchus Date: Wed, 18 Sep 2024 17:13:34 -0500 Subject: [PATCH] fix divide by 0 errors in --verbose output of progress tracking --- tools/project.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/project.py b/tools/project.py index 639f5a13..502b2f4b 100644 --- a/tools/project.py +++ b/tools/project.py @@ -1406,9 +1406,13 @@ def calculate_progress(config: ProjectConfig) -> 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] = {}