From feff05d135b317a47cf5ad7f26e7c572b2520d21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20Storsj=C3=B6?= Date: Wed, 24 Mar 2021 19:27:36 +0200 Subject: [PATCH] [lit] Fix check-lit hanging on Windows due to a division by zero exception --- llvm/utils/lit/lit/display.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/utils/lit/lit/display.py b/llvm/utils/lit/lit/display.py index ce346ee..51a05e8 100644 --- a/llvm/utils/lit/lit/display.py +++ b/llvm/utils/lit/lit/display.py @@ -56,7 +56,9 @@ class ProgressPredictor(object): total_time_remaining = self.predictable_time_remaining + unpredictable_time_remaining total_time = self.time_elapsed + total_time_remaining - return self.time_elapsed / total_time + if total_time > 0: + return self.time_elapsed / total_time + return 0 class NopDisplay(object): -- 2.7.4