[Python-checkins] python/dist/src/Lib/test test_signal.py,1.12,1.13
mwh@users.sourceforge.net
mwh@users.sourceforge.net
2003年3月13日 05:56:55 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1:/tmp/cvs-serv22379/Lib/test
Modified Files:
test_signal.py
Log Message:
Take out my (long since disabled) POSIX signal mask handling code.
I'm not going to have the time or energy to get this working x-platform
-- anyone who does is welcome to the code!
Index: test_signal.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_signal.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** test_signal.py 23 Jul 2002 19:04:01 -0000 1.12
--- test_signal.py 13 Mar 2003 13:56:52 -0000 1.13
***************
*** 65,127 ****
print "KeyboardInterrupt (assume the alarm() went off)"
-
- if hasattr(signal, "sigprocmask"):
- class HupDelivered(Exception):
- pass
- def hup(signum, frame):
- raise HupDelivered
- def hup2(signum, frame):
- signal.signal(signal.SIGHUP, hup)
- return
- signal.signal(signal.SIGHUP, hup)
-
- if verbose:
- print "blocking SIGHUP"
-
- defaultmask = signal.sigprocmask(signal.SIG_BLOCK, [signal.SIGHUP])
-
- if verbose:
- print "sending SIGHUP"
-
- try:
- os.kill(pid, signal.SIGHUP)
- except HupDelivered:
- raise TestFailed, "HUP not blocked"
-
- if signal.SIGHUP not in signal.sigpending():
- raise TestFailed, "HUP not pending"
-
- if verbose:
- print "unblocking SIGHUP"
-
- try:
- signal.sigprocmask(signal.SIG_UNBLOCK, [signal.SIGHUP])
- except HupDelivered:
- pass
- else:
- raise TestFailed, "HUP not delivered"
-
- if verbose:
- print "testing sigsuspend"
-
- signal.sigprocmask(signal.SIG_BLOCK, [signal.SIGHUP])
- signal.signal(signal.SIGHUP, hup2)
-
- if not os.fork():
- time.sleep(2)
- os.kill(pid, signal.SIGHUP)
- time.sleep(2)
- os.kill(pid, signal.SIGHUP)
- os._exit(0)
- else:
- try:
- signal.sigsuspend(defaultmask)
- except:
- raise TestFailed, "sigsuspend erroneously raised"
-
- try:
- signal.sigsuspend(defaultmask)
- except HupDelivered:
- pass
- else:
- raise TestFailed, "sigsupsend didn't raise"
--- 65,66 ----