| 74 | |
| 75 | |
| 76 | class _WorkItem: |
| 77 | def __init__(self, future, task): |
| 78 | self.future = future |
| 79 | self.task = task |
| 80 | |
| 81 | def run(self, ctx): |
| 82 | if not self.future.set_running_or_notify_cancel(): |
| 83 | return |
| 84 | |
| 85 | try: |
| 86 | result = ctx.run(self.task) |
| 87 | except BaseException as exc: |
| 88 | self.future.set_exception(exc) |
| 89 | # Break a reference cycle with the exception 'exc' |
| 90 | self = None |
| 91 | else: |
| 92 | self.future.set_result(result) |
| 93 | |
| 94 | __class_getitem__ = classmethod(types.GenericAlias) |
| 95 | |
| 96 | |
| 97 | def _worker(executor_reference, ctx, work_queue): |
no outgoing calls
no test coverage detected
searching dependent graphs…