Copy state from a future to a concurrent.futures.Future.
(concurrent, source)
| 338 | |
| 339 | |
| 340 | def _set_concurrent_future_state(concurrent, source): |
| 341 | """Copy state from a future to a concurrent.futures.Future.""" |
| 342 | assert source.done() |
| 343 | if source.cancelled(): |
| 344 | concurrent.cancel() |
| 345 | if not concurrent.set_running_or_notify_cancel(): |
| 346 | return |
| 347 | exception = source.exception() |
| 348 | if exception is not None: |
| 349 | concurrent.set_exception(_convert_future_exc(exception)) |
| 350 | else: |
| 351 | result = source.result() |
| 352 | concurrent.set_result(result) |
| 353 | |
| 354 | |
| 355 | def _copy_future_state(source, dest): |
no test coverage detected
searching dependent graphs…