|
@@ -123,10 +123,13 @@ class page:
|
|
with client:
|
|
with client:
|
|
return await result
|
|
return await result
|
|
task = background_tasks.create(wait_for_result())
|
|
task = background_tasks.create(wait_for_result())
|
|
|
|
+ task_wait_for_connection = background_tasks.create(
|
|
|
|
+ client._waiting_for_connection.wait(), # pylint: disable=protected-access
|
|
|
|
+ )
|
|
try:
|
|
try:
|
|
await asyncio.wait([
|
|
await asyncio.wait([
|
|
task,
|
|
task,
|
|
- asyncio.create_task(client._waiting_for_connection.wait()), # pylint: disable=protected-access
|
|
|
|
|
|
+ task_wait_for_connection,
|
|
], timeout=self.response_timeout, return_when=asyncio.FIRST_COMPLETED)
|
|
], timeout=self.response_timeout, return_when=asyncio.FIRST_COMPLETED)
|
|
except asyncio.TimeoutError as e:
|
|
except asyncio.TimeoutError as e:
|
|
raise TimeoutError(f'Response not ready after {self.response_timeout} seconds') from e
|
|
raise TimeoutError(f'Response not ready after {self.response_timeout} seconds') from e
|