This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright (C) 2013-2020 Vinay Sajip. New BSD License. | |
# | |
import os | |
import os.path | |
from subprocess import Popen, PIPE | |
import sys | |
from threading import Thread | |
from urllib.parse import urlparse | |
from urllib.request import urlretrieve |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fix keyboard interrupts when using multiprocessing.pool.imap(). | |
# Usage: | |
# import fix_multiprocessing.py | |
from multiprocessing.pool import IMapIterator | |
def wrapper(func): | |
def wrap(self, timeout=None): | |
# Note: the timeout of 1 googol seconds introduces a rather subtle |
NewerOlder