Fix running process() with a timeout (closes #3505)

This commit is contained in:
mathieui 2024-02-02 01:00:25 +01:00
parent 992d80dd09
commit 7128ea249b
No known key found for this signature in database
GPG Key ID: C59F84CEEFD616E3

View File

@ -524,7 +524,7 @@ class XMLStream(asyncio.BaseProtocol):
else:
self.loop.run_until_complete(self.disconnected)
else:
tasks: List[Awaitable] = [asyncio.sleep(timeout)]
tasks: List[Awaitable] = [asyncio.Task(asyncio.sleep(timeout))]
if not forever:
tasks.append(self.disconnected)
self.loop.run_until_complete(asyncio.wait(tasks))