Marco Paolini added the comment:

KeyboardInterrupt is not handled gently by asyncio (see 
https://groups.google.com/d/msg/python-tulip/sovg7EIBoXs/m7U-0UXqzSQJ)

you could cancel all tasks in the signal handler:

...

def sig_interrupt():
    print('interrupt')
    for task in asyncio.Task.all_tasks():
        task.cancel()

loop.add_signal_handler(signal.SIGINT, sig_interrupt)
...

----------
nosy: +mpaolini

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24080>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to