(a: "Future[_T]")
| 162 | """ |
| 163 | |
| 164 | def copy(a: "Future[_T]") -> None: |
| 165 | if b.done(): |
| 166 | return |
| 167 | if hasattr(a, "exc_info") and a.exc_info() is not None: # type: ignore |
| 168 | future_set_exc_info(b, a.exc_info()) # type: ignore |
| 169 | else: |
| 170 | a_exc = a.exception() |
| 171 | if a_exc is not None: |
| 172 | b.set_exception(a_exc) |
| 173 | else: |
| 174 | b.set_result(a.result()) |
| 175 | |
| 176 | if isinstance(a, Future): |
| 177 | future_add_done_callback(a, copy) |
nothing calls this directly
no test coverage detected