(self)
| 390 | return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED] |
| 391 | |
| 392 | def __get_result(self): |
| 393 | if self._exception is not None: |
| 394 | try: |
| 395 | raise self._exception |
| 396 | finally: |
| 397 | # Break a reference cycle with the exception in self._exception |
| 398 | self = None |
| 399 | else: |
| 400 | return self._result |
| 401 | |
| 402 | def add_done_callback(self, fn): |
| 403 | """Attaches a callable that will be called when the future finishes. |