def close_hook(): # Make sure this is a forceful close assert trio.current_effective_deadline() == float("-inf") record.append("closed")
def close_hook(): # Make sure this is a forceful close assert trio.current_effective_deadline() == float("-inf") record.append(("closed"))
async def run_sync(self, sync_fn: Callable, *args) -> Optional[Outcome]: await trio.lowlevel.checkpoint() if self.retire is not _special_none_making_retire: return capture(lambda *a: (sync_fn, args, trio.current_effective_deadline()))