From 51be1a0cd733e7b237884a69efb9908a4af2eee3 Mon Sep 17 00:00:00 2001 From: Andreas Maier Date: Mon, 6 Feb 2017 09:55:26 +0100 Subject: [PATCH] Clean out spinner character when done. Details: - The loop that writes the spinner characters already attempts to have a clean output when the spinner is sopped, by ending with the backslash character. However, there was no flush after the write of the backslash, so that the last spinner character could still be seen. This change adds a flush after the writing of the backslash. Signed-off-by: Andreas Maier --- click_spinner/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/click_spinner/__init__.py b/click_spinner/__init__.py index c64a6ee..0a40cff 100644 --- a/click_spinner/__init__.py +++ b/click_spinner/__init__.py @@ -30,6 +30,7 @@ def init_spin(self): sys.stdout.flush() time.sleep(0.25) sys.stdout.write('\b') + sys.stdout.flush() def __enter__(self): self.start()