python-trio / trio-asyncio

a re-implementation of the asyncio mainloop on top of Trio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Check loop context

smurfix opened this issue · comments

Now that we have contextvar support, add one that remembers whether we're currently in an asyncio or a Trio context.
This shall catch erroneous nested calls of run_asyncio and run_trio. Missing calls to these might be possible but needs to be invesigated further.

Update: use sniffio to do that