Skip to content Skip to sidebar Skip to footer

Python Process Won't Call Atexit

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 atexit import logging import multiprocessing logging

Solution 1:

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.

Post a Comment for "Python Process Won't Call Atexit"