Skip to content

Instantly share code, notes, and snippets.

import trio
async def sleeper():
try:
await trio.sleep(30)
except KeyboardInterrupt:
print("KBInterrupt")
async def test():
with trio.open_cancel_scope() as cancel_scope: