This module provides mechanisms to use signal handlers in Python. Some general rules for working with signals and their handlers:
The variables defined in the signal module are:
<signal.h>
.
The Unix man page for `signal()' lists the existing
signals (on some systems this is signal(2), on others the
list is in signal(7)).
Note that not all systems define the same set of signal names; only
those names defined by the system are defined by this module.
The signal module defines the following functions:
time) |
signalnum) |
None
means that the previous signal handler was not installed
from Python.
) |
fd) |
0
byte is written to the fd. This can be used by a library
to wakeup a poll or select call, allowing the signal to be fully
processed.
The old wakeup fd is returned. fd must be non-blocking. It is up to the library to remove any bytes before calling poll or select again.
When threads are enabled, this function can only be called from the main thread; attempting to call it from other threads will cause a ValueError exception to be raised.
This is an Ubuntu specific addition, backported from 2.6.
signalnum, handler) |
When threads are enabled, this function can only be called from the main thread; attempting to call it from other threads will cause a ValueError exception to be raised.
The handler is called with two arguments: the signal number
and the current stack frame (None
or a frame object;
for a description of frame objects, see the reference manual section
on the standard type hierarchy or see the attribute descriptions in
the inspect module).