From bebb8b94b46b9e3ebf5c5bac32be79d9d662b8dc Mon Sep 17 00:00:00 2001 From: Caleb Hattingh Date: Mon, 5 Aug 2024 17:15:33 +0200 Subject: [PATCH] Ensure created task has a ref. Fixes #87 (#90) --- aiorun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiorun.py b/aiorun.py index 041e4b4..fa2d1ca 100644 --- a/aiorun.py +++ b/aiorun.py @@ -72,7 +72,7 @@ async def coro_proxy(): new_coro = coro_proxy() # We'll taskify this one instead of coro. _DO_NOT_CANCEL_COROS.add(new_coro) # The new task must not be cancelled. - loop.create_task(new_coro) # Make the task + _background_task = loop.create_task(new_coro) # Make the task # Ok, so we *could* simply return fut. Callers can await it as normal, # e.g.