cpython: 44e77709daa4 (original) (raw)

Mercurial > cpython

changeset 93486:44e77709daa4

- Issue #22841: Reject coroutines in asyncio add_signal_handler(). Patch by Ludovic.Gasc. [#22841]

Guido van Rossum guido@python.org
date Fri, 14 Nov 2014 11:48:37 -0800
parents 19b2c54e5f09(current diff)d244e1770f1b(diff)
children 97dc64adb6fe
files Lib/asyncio/unix_events.py Lib/test/test_asyncio/test_unix_events.py Misc/NEWS
diffstat 3 files changed, 18 insertions(+), 0 deletions(-)[+] [-] Lib/asyncio/unix_events.py 3 Lib/test/test_asyncio/test_unix_events.py 12 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -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_ev Raise ValueError if the signal number is invalid or uncatchable. Raise RuntimeError if there is a problem setting up the handler. """

--- a/Lib/test/test_asyncio/test_unix_events.py +++ b/Lib/test/test_asyncio/test_unix_events.py @@ -64,6 +64,18 @@ class SelectorEventLoopSignalTests(test_ signal.SIGINT, lambda: True) @mock.patch('asyncio.unix_events.signal')

+

+

+

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -183,6 +183,9 @@ Core and Builtins Library ------- +- Issue #22841: Reject coroutines in asyncio add_signal_handler().