An asyncio example
Terry Reedy
tjreedy at udel.edu
Sat Jul 4 16:22:41 EDT 2015
On 7/4/2015 3:04 AM, Adam Bartoš wrote:
> This is a minimal example:
>
> import asyncio
>
> async def wait():
> await asyncio.sleep(5)
>
> loop = asyncio.get_event_loop()
> loop.run_until_complete(wait())
>
> Ctrl-C doesn't interrupt the waiting, instead KeyboardInterrupt occurs
> after those five seconds. It's 3.5.0b2 on Windows. Is it a bug?
I asked on pydev list and was pointed to
https://bugs.python.org/issue23057
(where treated as missing feature ). It is desired that this stop
immediately on Windows as on Unix.
I suggest you post your minimal example there. User interest in an
issue being fixed and willingness to test patches can help motivate.
Even more minimal:
import asyncio
loop = asyncio.get_event_loop()
loop.run_forever
also not interruptible,
--
Terry Jan Reedy
More information about the Python-list
mailing list