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

Method _check_signal

Lib/asyncio/unix_events.py:177–187  ·  view source on GitHub ↗

Internal helper to validate a signal. Raise ValueError if the signal number is invalid or uncatchable. Raise RuntimeError if there is a problem setting up the handler.

(self, sig)

Source from the content-addressed store, hash-verified

175 return True
176
177 def _check_signal(self, sig):
178 """Internal helper to validate a signal.
179
180 Raise ValueError if the signal number is invalid or uncatchable.
181 Raise RuntimeError if there is a problem setting up the handler.
182 """
183 if not isinstance(sig, int):
184 raise TypeError(f'sig must be an int, not {sig!r}')
185
186 if sig not in signal.valid_signals():
187 raise ValueError(f'invalid signal number {sig}')
188
189 def _make_read_pipe_transport(self, pipe, protocol, waiter=None,
190 extra=None):

Callers 2

add_signal_handlerMethod · 0.95
remove_signal_handlerMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected