MCPcopy Create free account
hub / github.com/EasyIME/PIME / future_set_exc_info

Function future_set_exc_info

python/python3/tornado/concurrent.py:211–232  ·  view source on GitHub ↗

Set the given ``exc_info`` as the `Future`'s exception. Understands both `asyncio.Future` and the extensions in older versions of Tornado to enable better tracebacks on Python 2. .. versionadded:: 5.0 .. versionchanged:: 6.0 If the future is already cancelled, this functio

(
    future: "Union[futures.Future[_T], Future[_T]]",
    exc_info: Tuple[
        Optional[type], Optional[BaseException], Optional[types.TracebackType]
    ],
)

Source from the content-addressed store, hash-verified

209
210
211def future_set_exc_info(
212 future: "Union[futures.Future[_T], Future[_T]]",
213 exc_info: Tuple[
214 Optional[type], Optional[BaseException], Optional[types.TracebackType]
215 ],
216) -> None:
217 """Set the given ``exc_info`` as the `Future`'s exception.
218
219 Understands both `asyncio.Future` and the extensions in older
220 versions of Tornado to enable better tracebacks on Python 2.
221
222 .. versionadded:: 5.0
223
224 .. versionchanged:: 6.0
225
226 If the future is already cancelled, this function is a no-op.
227 (previously ``asyncio.InvalidStateError`` would be raised)
228
229 """
230 if exc_info[1] is None:
231 raise Exception("future_set_exc_info called with no exception")
232 future_set_exception_unless_cancelled(future, exc_info[1])
233
234
235@typing.overload

Callers 9

wrapperFunction · 0.90
callbackFunction · 0.90
runMethod · 0.90
handle_yieldMethod · 0.90
handle_exceptionMethod · 0.90
runMethod · 0.90
errbackFunction · 0.90
submitMethod · 0.85
copyFunction · 0.85

Tested by

no test coverage detected