(self)
| 24 | request._event.set() # pylint: disable=protected-access |
| 25 | |
| 26 | def __await__(self) -> Any: |
| 27 | try: |
| 28 | yield from asyncio.wait_for(self._event.wait(), self.timeout).__await__() |
| 29 | except asyncio.TimeoutError as e: |
| 30 | raise TimeoutError(f'JavaScript did not respond within {self.timeout:.1f} s') from e |
| 31 | else: |
| 32 | return self._result |
| 33 | finally: |
| 34 | self._instances.pop(self.request_id) |