mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
- Issue #22841: Reject coroutines in asyncio add_signal_handler().
Patch by Ludovic.Gasc.
This commit is contained in:
parent
6c14f23100
commit
e36fcde383
3 changed files with 18 additions and 0 deletions
|
@ -13,6 +13,7 @@ import threading
|
|||
from . import base_events
|
||||
from . import base_subprocess
|
||||
from . import constants
|
||||
from . import coroutines
|
||||
from . import events
|
||||
from . import selector_events
|
||||
from . import selectors
|
||||
|
@ -66,6 +67,8 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
|
|||
Raise ValueError if the signal number is invalid or uncatchable.
|
||||
Raise RuntimeError if there is a problem setting up the handler.
|
||||
"""
|
||||
if coroutines.iscoroutinefunction(callback):
|
||||
raise TypeError("coroutines cannot be used with call_soon()")
|
||||
self._check_signal(sig)
|
||||
try:
|
||||
# set_wakeup_fd() raises ValueError if this is not the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue