A class for catching SIGINT, such that CTRL+c works.
This class solves two problems with multithreaded programs in Python:
- A signal might be delivered to any thread and
- if the thread that gets the signal is waiting, the signal is ignored (which is a bug).
This class forks and catches sigint for Exscript.
The watcher is a concurrent process (not thread) that waits for a signal and the process that contains the threads. Works on Linux, Solaris, MacOS, and AIX. Known not to work on Windows.
Creates a child process, which returns. The parent process waits for a KeyboardInterrupt and then kills the child process.