MCPcopy Index your code
hub / github.com/python/cpython / wait_signal

Method wait_signal

Lib/test/signalinterproctester.py:26–40  ·  view source on GitHub ↗
(self, child, signame)

Source from the content-addressed store, hash-verified

24 raise SIGUSR1Exception
25
26 def wait_signal(self, child, signame):
27 if child is not None:
28 # This wait should be interrupted by exc_class
29 # (if set)
30 child.wait()
31
32 start_time = time.monotonic()
33 for _ in support.busy_retry(support.SHORT_TIMEOUT, error=False):
34 if self.got_signals[signame]:
35 return
36 signal.pause()
37 else:
38 dt = time.monotonic() - start_time
39 self.fail('signal %s not received after %.1f seconds'
40 % (signame, dt))
41
42 def subprocess_send_signal(self, pid, signame):
43 code = 'import os, signal; os.kill(%s, signal.%s)' % (pid, signame)

Callers 1

Calls 3

waitMethod · 0.45
pauseMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected