From 68ae281c5e99fb99fdeade0981a2be0cf1121b9d Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 12 Jun 2024 14:44:48 +1000 Subject: [PATCH] aioble/multitests: Store a reference to return value of create_task. As required by CPython, and enforced by Ruff RUF006. Signed-off-by: Damien George --- micropython/bluetooth/aioble/multitests/ble_write_order.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/micropython/bluetooth/aioble/multitests/ble_write_order.py b/micropython/bluetooth/aioble/multitests/ble_write_order.py index ca47f3837..43ee09f8f 100644 --- a/micropython/bluetooth/aioble/multitests/ble_write_order.py +++ b/micropython/bluetooth/aioble/multitests/ble_write_order.py @@ -44,12 +44,12 @@ async def instance0_task(): # Register characteristic.written() handlers as asyncio background tasks. # The order of these is important! - asyncio.create_task(task_written(characteristic_second, "second")) - asyncio.create_task(task_written(characteristic_first, "first")) + task_second = asyncio.create_task(task_written(characteristic_second, "second")) + task_first = asyncio.create_task(task_written(characteristic_first, "first")) # This dummy task simulates background processing on a real system that # can block the asyncio loop for brief periods of time - asyncio.create_task(task_dummy()) + task_dummy = asyncio.create_task(task_dummy()) multitest.globals(BDADDR=aioble.config("mac")) multitest.next()