def finish ( ) : out . warn ( "Interrupted!" ) for t in threads : t . stop ( ) jobs . clear ( ) out . warn ( "Waiting for download threads to finish." )
how to close threads in python
Print warning about interrupt and empty the job queue .
def finish():
    """Print warning about interrupt and empty the job queue."""
    out.warn("Interrupted!")
    for t in threads:
        t.stop()
    jobs.clear()
    out.warn("Waiting for download threads to finish.")