asyncio-ipython-magic icon indicating copy to clipboard operation
asyncio-ipython-magic copied to clipboard

extension is not ^C-safe

Open dimaqq opened this issue 8 years ago • 0 comments

For example:

In [1]: import asyncio
In [2]: l = asyncio.Lock()
In [7]: %await_ l
# OK
In [8]: %await_ l
# waits forever, since lock is already taken, so let's break it:
^C---------------------------------------------------------------------------
KeyboardInterrupt
[backtrace omitted]
KeyboardInterrupt:

In [10]: l.release()
# OK
In [11]: %await_ l
---------------------------------------------------------------------------
RuntimeError
[backtrace omitted]
~/.pyenv/versions/3.6.1/lib/python3.6/asyncio/base_events.py in run_until_complete(self, future)
    462         future.remove_done_callback(_run_until_complete_cb)
    463         if not future.done():
--> 464             raise RuntimeError('Event loop stopped before Future completed.')
    465
    466         return future.result()

RuntimeError: Event loop stopped before Future completed.

dimaqq avatar Jun 30 '17 10:06 dimaqq