# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
-import os, re, sys
+import os, re, sys, signal
if os.name == "posix":
- import resource, fcntl, signal
+ import resource, fcntl
import subprocess
from shutil import copyfile, rmtree
from select import select
-from time import time, localtime
+from time import time, localtime, sleep
all_tasks_running = []
if os.name == "posix":
signal.signal(signal.SIGHUP, force_shutdown)
- signal.signal(signal.SIGINT, force_shutdown)
- signal.signal(signal.SIGTERM, force_shutdown)
+signal.signal(signal.SIGINT, force_shutdown)
+signal.signal(signal.SIGTERM, force_shutdown)
def process_filename(filename):
if filename.startswith("~/"):
select(fds, [], [], 1.0) == ([], [], [])
except InterruptedError:
pass
+ else:
+ sleep(0.1)
for task in self.tasks_running:
task.poll()