python-trio / trio-asyncio

a re-implementation of the asyncio mainloop on top of Trio
Other
189 stars 38 forks source link

Check loop context #21

Open smurfix opened 6 years ago

smurfix commented 6 years ago

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.

smurfix commented 6 years ago

Update: use sniffio to do that