I\'m trying to use atexit
in a Process
, but unfortunately it doesn\'t seem to work. Here\'s some example code:
import time
import a
As the docs say,
On Unix this is done using the SIGTERM signal; on Windows TerminateProcess() is used. Note that exit handlers and finally clauses, etc., will not be executed.
If you're on Unix, you should be able intercept SIGTERM
with signal, and perform whatever "termination activities" you need; however, I don't know of a cross-platform solution.