-
-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
this works for trio curio and asyncio already. All twisted needs to do is implement set_asyncgen_hooks
def sniffio(_get_asyncgen_hooks=sys._get_asyncgen_hooks):
hooks = _get_asyncgen_hooks()
finalizer = hooks.finalizer
if finalizer is not None:
return finalizer.__module__.partition(".")[0]
firstiter = hooks.firstiter
if firstiter is not None:
return firstiter.__module__.partition(".")[0]trio-asyncio can twiddle with hooks.finalizer.__module__ to go back and forth between asyncio and trio
Metadata
Metadata
Assignees
Labels
No labels