MCPcopy
hub / github.com/tornadoweb/tornado / copy

Function copy

tornado/concurrent.py:164–174  ·  view source on GitHub ↗
(a: "Future[_T]")

Source from the content-addressed store, hash-verified

162 """
163
164 def copy(a: "Future[_T]") -> None:
165 if b.done():
166 return
167 if hasattr(a, "exc_info") and a.exc_info() is not None: # type: ignore
168 future_set_exc_info(b, a.exc_info()) # type: ignore
169 else:
170 a_exc = a.exception()
171 if a_exc is not None:
172 b.set_exception(a_exc)
173 else:
174 b.set_result(a.result())
175
176 if isinstance(a, Future):
177 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