diff --git a/archiver/util.py b/archiver/util.py index 14f8ccff..e4c7dbe3 100644 --- a/archiver/util.py +++ b/archiver/util.py @@ -161,7 +161,13 @@ def progress(seconds=TIMEOUT, prefix=''): def end(): """immediately finish progress and clear the progressbar line""" + nonlocal p + if p is None: # protect from double termination + return + p.terminate() + p = None + sys.stdout.write('\r{}{}\r'.format((' ' * TERM_WIDTH), ANSI['reset'])) # clear whole terminal line sys.stdout.flush()