I'm doing something like this
def exitHandler(self, *args):
self.stopThreads()
sys.exit(2)
and I register that function in my self.run (working with a daemonized programm)
signal.signal(signal.SIGTERM, self.exitHandler)
self.stopThreads() sometimes takes a while to finish. Im stopping subprocesses called started by those threads. When the signal handler gets called multiple times I get error messages like this:
Exception SystemExit: 2 in <bound method Popen.__del__ of <subprocess.Popen object at 0x929d10c>> ignored
Everything is fine, even with the ignored exception all my processes an threads finish as they should. I'm curious what I'm doing wrong and how to get rid of the ignored exception error.