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

Function _value_from_stopiteration

tornado/gen.py:138–150  ·  view source on GitHub ↗
(e: Union[StopIteration, "Return"])

Source from the content-addressed store, hash-verified

136
137
138def _value_from_stopiteration(e: Union[StopIteration, "Return"]) -> Any:
139 try:
140 # StopIteration has a value attribute beginning in py33.
141 # So does our Return class.
142 return e.value
143 except AttributeError:
144 pass
145 try:
146 # Cython backports coroutine functionality by putting the value in
147 # e.args[0].
148 return e.args[0]
149 except (AttributeError, IndexError):
150 return None
151
152
153def _create_future() -> Future:

Callers 2

wrapperFunction · 0.85
runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected