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

Guido van Rossum report at bugs.python.org
Wed Dec 17 00:53:31 CET 2014


Guido van Rossum added the comment:

Well, the PEP clearly states that get_event_loop() should never return None
and raise an exception if the context has no environment. (Where context ~~
thread.)

On Tue, Dec 16, 2014 at 3:48 PM, STINNER Victor <report at bugs.python.org>
wrote:
>
>
> STINNER Victor added the comment:
>
> Guido wrote:
> > I'm okay with this approach now.
>
> I'm not sure that I understood your opinion. Are you ok to raise an
> exception in debug mode if call_soon() is called from a thread which has no
> event loop attached?
>
> (Currently, an exception is already raised in debug mode, but only if the
> thread has an attached event loop, but not the good one.)
>
> ----------
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <http://bugs.python.org/issue22926>
> _______________________________________
>

----------

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


More information about the Python-bugs-list mailing list