You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Python 3.7, the C runtime caches get_running_loop_policy()
so we can no longer monkey-patch it effectively.
On the other hand, we really want per-thread loop policies.
Thus, the Trio loop policy is (again) installed unconditionally.
`get_running_loop_policy()` now does this:
* when Trio is running: return itself.
* otherwise: return a per-thread policy, or the original loop policy.
* `set_running_loop_policy()` refuses to install a TrioPolicy,
and otherwise installs into a per-thread variable.
All methods of `TrioPolicy` now unconditionally access the current
task's loop (as per contextvar) if they're running within Trio.
Otherwise they defer to the per-thread loop policy.
0 commit comments