()
| 377 | if timeout: |
| 378 | |
| 379 | def timeout_func() -> None: |
| 380 | try: |
| 381 | raise self.failureException( |
| 382 | "Async operation timed out after %s seconds" % timeout |
| 383 | ) |
| 384 | except Exception: |
| 385 | self.__failure = sys.exc_info() |
| 386 | self.stop() |
| 387 | |
| 388 | self.__timeout = self.io_loop.add_timeout( |
| 389 | self.io_loop.time() + timeout, timeout_func |