Lines Matching refs:signal
7 import signal
80 signal.signal(signal.SIGHUP, self.handlerA)
81 signal.signal(signal.SIGUSR1, self.handlerB)
82 signal.signal(signal.SIGUSR2, signal.SIG_IGN)
83 signal.signal(signal.SIGALRM, signal.default_int_handler)
124 signal.alarm(1)
128 signal.pause()
142 signal.alarm(0)
186 os.kill(child, signal.SIGKILL)
200 self.assertRaises(ValueError, signal.getsignal, 4242)
202 self.assertRaises(ValueError, signal.signal, 4242,
206 self.assertRaises(TypeError, signal.signal,
207 signal.SIGUSR1, None)
210 hup = signal.signal(signal.SIGHUP, self.trivial_signal_handler)
211 self.assertEqual(signal.getsignal(signal.SIGHUP),
213 signal.signal(signal.SIGHUP, hup)
214 self.assertEqual(signal.getsignal(signal.SIGHUP), hup)
222 for sig in (signal.SIGABRT, signal.SIGBREAK, signal.SIGFPE,
223 signal.SIGILL, signal.SIGINT, signal.SIGSEGV,
224 signal.SIGTERM):
226 signal.signal(sig, signal.signal(sig, handler))
229 signal.signal(-1, handler)
232 signal.signal(7, handler)
239 self.assertRaises(ValueError, signal.set_wakeup_fd, fd)
250 signal.alarm(1)
258 signal.alarm(0)
268 signal.alarm(1)
276 signal.alarm(0)
283 self.alrm = signal.signal(signal.SIGALRM, lambda x,y:None)
288 self.old_wakeup = signal.set_wakeup_fd(self.write)
291 signal.set_wakeup_fd(self.old_wakeup)
294 signal.signal(signal.SIGALRM, self.alrm)
304 self.signum = signal.SIGUSR1
305 oldhandler = signal.signal(self.signum, lambda x,y: None)
306 self.addCleanup(signal.signal, self.signum, oldhandler)
378 signal.siginterrupt(self.signum, 1)
390 signal.siginterrupt(self.signum, 0)
404 self.old_alarm = signal.signal(signal.SIGALRM, self.sig_alrm)
407 signal.signal(signal.SIGALRM, self.old_alarm)
410 signal.setitimer(self.itimer, 0)
422 raise signal.ItimerError("setitimer didn't disable ITIMER_VIRTUAL "
426 signal.setitimer(signal.ITIMER_VIRTUAL, 0)
437 signal.setitimer(signal.ITIMER_PROF, 0)
445 self.assertRaises(signal.ItimerError, signal.setitimer, -1, 0)
448 self.assertRaises(signal.ItimerError,
449 signal.setitimer, signal.ITIMER_REAL, -1)
452 self.itimer = signal.ITIMER_REAL
453 signal.setitimer(self.itimer, 1.0)
456 signal.pause()
464 self.itimer = signal.ITIMER_VIRTUAL
465 signal.signal(signal.SIGVTALRM, self.sig_vtalrm)
466 signal.setitimer(self.itimer, 0.3, 0.2)
472 if signal.getitimer(self.itimer) == (0.0, 0.0):
479 self.assertEqual(signal.getitimer(self.itimer), (0.0, 0.0))
487 self.itimer = signal.ITIMER_PROF
488 signal.signal(signal.SIGPROF, self.sig_prof)
489 signal.setitimer(self.itimer, 0.2, 0.2)
495 if signal.getitimer(self.itimer) == (0.0, 0.0):
502 self.assertEqual(signal.getitimer(self.itimer), (0.0, 0.0))
510 self.itimer = signal.ITIMER_REAL
511 signal.setitimer(self.itimer, 1e-6)