[issue22926] asyncio: raise an exception when called from the wrong thread

STINNER Victor report at bugs.python.org
Fri Nov 28 14:11:47 CET 2014


STINNER Victor added the comment:

Here is a patch without unit:

- modify get_event_loop() to always raise a RuntimeError if the thread has no event loop. Before an AssertionError was not raised if python runs with -O option
- modify BaseEventLoop._assert_is_current_event_loop() to fail if the thread has an event loop
- modify tests to set the event loop to the newly created event loop, instead of setting it to None

----------
keywords: +patch
Added file: http://bugs.python.org/file37303/asyncio_thread.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22926>
_______________________________________


More information about the Python-bugs-list mailing list