Skip to content

Commit 6449a47

Browse files
committed
Ensure we hold strong references to tasks
see python/cpython#88831
1 parent 380f0b0 commit 6449a47

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

aioesphomeapi/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def _cleanup(self) -> None:
158158

159159
if self.on_stop and self._connect_complete:
160160

161-
def _remove_on_stop_task():
161+
def _remove_on_stop_task(_fut: asyncio.Future) -> None:
162162
"""Remove the stop task from the reconnect loop.
163163
164164
We need to do this because the asyncio does not hold

aioesphomeapi/reconnect_logic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ async def stop(self) -> None:
201201
await self._stop_zc_listen()
202202

203203
def stop_callback(self) -> None:
204-
def _remove_stop_task() -> None:
204+
def _remove_stop_task(_fut: asyncio.Future) -> None:
205205
"""Remove the stop task from the reconnect loop.
206206
207207
We need to do this because the asyncio does not hold

0 commit comments

Comments
 (0)