SIGTERM handling

M

Manlio Perillo

Hi.

I have tried this script:

from ctypes import cdll, c_int
from signal import SIGTERM, SIGINT
from time import sleep


msvcrt = cdll.LoadLibrary("MSVCR71") # is this the lib to use?
sig = c_int(SIGTERM)
raise_ = getattr(msvcrt, "raise")
raise_(sig)
sleep(10)


The problem is that SIGTERM causes the program to exit (without calling
atexit registered functions).

Why?
In the MSDN documentations it is written that SIGTERM is by default
ignored and in the Python documentation for signal module it is written
that there should be no handler for SIGTERM.



Thanks Manlio Perillo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top