MCPcopy Index your code
hub / github.com/python/cpython / throw

Method throw

Lib/_collections_abc.py:164–174  ·  view source on GitHub ↗

Raise an exception in the coroutine. Return next yielded value or raise StopIteration.

(self, typ, val=None, tb=None)

Source from the content-addressed store, hash-verified

162
163 @abstractmethod
164 def throw(self, typ, val=None, tb=None):
165 """Raise an exception in the coroutine.
166 Return next yielded value or raise StopIteration.
167 """
168 if val is None:
169 if tb is None:
170 raise typ
171 val = typ()
172 if tb is not None:
173 val = val.with_traceback(tb)
174 raise val
175
176 def close(self):
177 """Raise GeneratorExit inside coroutine.

Callers 1

closeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected