(loop)
| 205 | |
| 206 | |
| 207 | def _cancel_all_tasks(loop): |
| 208 | to_cancel = tasks.all_tasks(loop) |
| 209 | if not to_cancel: |
| 210 | return |
| 211 | |
| 212 | for task in to_cancel: |
| 213 | task.cancel() |
| 214 | |
| 215 | loop.run_until_complete(tasks.gather(*to_cancel, return_exceptions=True)) |
| 216 | |
| 217 | for task in to_cancel: |
| 218 | if task.cancelled(): |
| 219 | continue |
| 220 | if task.exception() is not None: |
| 221 | loop.call_exception_handler({ |
| 222 | 'message': 'unhandled exception during asyncio.run() shutdown', |
| 223 | 'exception': task.exception(), |
| 224 | 'task': task, |
| 225 | }) |
no test coverage detected
searching dependent graphs…