diff --git a/examples/start_stop_counter.py b/examples/start_stop_counter.py index ef1f415..c8c2ab9 100755 --- a/examples/start_stop_counter.py +++ b/examples/start_stop_counter.py @@ -32,6 +32,8 @@ def start_stop(): event = asyncio.Event() # Start background task -asyncio.get_event_loop_policy().get_event_loop().create_task(counter()) +loop = asyncio.new_event_loop() +asyncio.set_event_loop(loop) +task = loop.create_task(counter()) async_mainloop(root) diff --git a/pyproject.toml b/pyproject.toml index 56a282d..351788f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,4 +72,5 @@ fixable = ["ALL"] "S311", "PL", "INP001", + "RUF006", ] \ No newline at end of file