(f)
| 517 | counter = len(fs) |
| 518 | |
| 519 | def _on_completion(f): |
| 520 | nonlocal counter |
| 521 | counter -= 1 |
| 522 | if (counter <= 0 or |
| 523 | return_when == FIRST_COMPLETED or |
| 524 | return_when == FIRST_EXCEPTION and (not f.cancelled() and |
| 525 | f.exception() is not None)): |
| 526 | if timeout_handle is not None: |
| 527 | timeout_handle.cancel() |
| 528 | if not waiter.done(): |
| 529 | waiter.set_result(None) |
| 530 | |
| 531 | for f in fs: |
| 532 | f.add_done_callback(_on_completion) |
nothing calls this directly
no test coverage detected