This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mpaolini
Recipients gvanrossum, matt, mpaolini, vstinner, yselivanov
Date 2015-04-30.20:34:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1430426085.17.0.246654988852.issue24080@psf.upfronthosting.co.za>
In-reply-to
Content
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)
...
History
Date User Action Args
2015-04-30 20:34:45mpaolinisetrecipients: + mpaolini, gvanrossum, vstinner, matt, yselivanov
2015-04-30 20:34:45mpaolinisetmessageid: <1430426085.17.0.246654988852.issue24080@psf.upfronthosting.co.za>
2015-04-30 20:34:45mpaolinilinkissue24080 messages
2015-04-30 20:34:44mpaolinicreate