MCPcopy
hub / github.com/opendevops-cn/opendevops / copy

Function copy

scripts/tornado_source_code/tornado/concurrent.py:154–163  ·  view source on GitHub ↗
(future: "Future[_T]")

Source from the content-addressed store, hash-verified

152 """
153
154 def copy(future: "Future[_T]") -> None:
155 assert future is a
156 if b.done():
157 return
158 if hasattr(a, "exc_info") and a.exc_info() is not None: # type: ignore
159 future_set_exc_info(b, a.exc_info()) # type: ignore
160 elif a.exception() is not None:
161 b.set_exception(a.exception())
162 else:
163 b.set_result(a.result())
164
165 if isinstance(a, Future):
166 future_add_done_callback(a, copy)

Callers

nothing calls this directly

Calls 3

future_set_exc_infoFunction · 0.85
resultMethod · 0.80
doneMethod · 0.45

Tested by

no test coverage detected