From 6da8a6dc80a4e754cf451a76ec497bcc608a6fa7 Mon Sep 17 00:00:00 2001 From: Gavin Mak Date: Thu, 26 Jun 2025 18:08:34 +0000 Subject: [PATCH] progress: Make end() idempotent This fixes the double "done" text on successful interleaved sync. Change-Id: I4f01418cb0340129a8f0a2a5835f7e3fa6a6b119 --- progress.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/progress.py b/progress.py index a386f426d..31a4890a6 100644 --- a/progress.py +++ b/progress.py @@ -101,6 +101,7 @@ class Progress: self._units = units self._elide = elide and _TTY self._quiet = quiet + self._ended = False # Only show the active jobs section if we run more than one in parallel. self._show_jobs = False @@ -211,6 +212,10 @@ class Progress: self.update(inc=0) def end(self): + if self._ended: + return + self._ended = True + self._update_event.set() if not _TTY or IsTraceToStderr() or self._quiet: return