mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-17 20:01:44 +02:00
Merge pull request #115 from karlicoss/fix-descriptor-leak
Fix 'Too many open files' error.
This commit is contained in:
@@ -161,7 +161,13 @@ def progress(seconds=TIMEOUT, prefix=''):
|
|||||||
|
|
||||||
def end():
|
def end():
|
||||||
"""immediately finish progress and clear the progressbar line"""
|
"""immediately finish progress and clear the progressbar line"""
|
||||||
|
nonlocal p
|
||||||
|
if p is None: # protect from double termination
|
||||||
|
return
|
||||||
|
|
||||||
p.terminate()
|
p.terminate()
|
||||||
|
p = None
|
||||||
|
|
||||||
sys.stdout.write('\r{}{}\r'.format((' ' * TERM_WIDTH), ANSI['reset'])) # clear whole terminal line
|
sys.stdout.write('\r{}{}\r'.format((' ' * TERM_WIDTH), ANSI['reset'])) # clear whole terminal line
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user