Can't catch SIGUSR1
Carsten Gaebler
clpy at snakefarm.org
Mon Dec 10 09:48:22 EST 2001
Hi there,
I'm experiencing a strange problem with this short test script which
is supposed to catch a SIGUSR1:
<test.py>
#! /usr/bin/python
import os, signal
got_signal = 0
def signal_handler(signo, frame):
global got_signal
got_signal = 1
signal.signal(signal.SIGUSR1, signal_handler)
os.kill(os.getpid(), signal.SIGUSR1)
print got_signal
</test.py>
Obviously it should always print '1', which it does on my desktop
machine (Linux kernel 2.2.14). But if I run it on a different machine
(kernel 2.2.19) it prints '0'. This problem applies to SIGUSR1 only,
SIGINT, SIGTERM, SIGUSR2 work fine.
Any ideas?
Regards
Carsten.
--
'In iteger arithetric divsion is no the oposite of multiplication.'
-- scenes from comp.lang.python
More information about the Python-list
mailing list