Skip to content

Commit

Permalink
Replace asyncio.wait_for with asyncio.timeout
Browse files Browse the repository at this point in the history
Fallback to using async_timeout on older python

asyncio.wait_for has some underlying problems that are only fixed in
cpython 3.12. See python/cpython#98518
  • Loading branch information
bdraco committed Jul 21, 2023
1 parent dae93fd commit fe6a6f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kasa/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ async def _query(self, request: str, retry_count: int, timeout: int) -> Dict:
assert self.reader is not None
assert self.writer is not None
async with asyncio_timeout(timeout):
await self._execute_query(request)
return await self._execute_query(request)
except Exception as ex:
await self.close()
if retry >= retry_count:
Expand Down

0 comments on commit fe6a6f5

Please sign in to comment.