Message353939
Python just exposes thin wrappers around the underlying libc calls, so you have to understand how those work.
On Linux, the sigwaitinfo() man page says:
NOTES
In normal usage, the calling program blocks the signals in
set via a prior call to sigprocmask(2) (so that the default
disposition for these signals does not occur if they become
pending between successive calls to sigwaitinfo() or sig‐
timedwait()) and does not establish handlers for these sig‐
nals.
So you need to block the given signal with pthread_sigmask() before waiting on it. For example:
>>> import signal
>>> signal.pthread_sigmask(signal.SIG_BLOCK, [signal.SIGHUP])
set()
>>> signal.sigwait([signal.SIGHUP])
<Signals.SIGHUP: 1> |
|
Date |
User |
Action |
Args |
2019-10-04 12:43:51 | pitrou | set | recipients:
+ pitrou, Blindfreddy |
2019-10-04 12:43:51 | pitrou | set | messageid: <1570193031.64.0.105866218895.issue38284@roundup.psfhosted.org> |
2019-10-04 12:43:51 | pitrou | link | issue38284 messages |
2019-10-04 12:43:51 | pitrou | create | |
|