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

Method close

Lib/_collections_abc.py:176–184  ·  view source on GitHub ↗

Raise GeneratorExit inside coroutine.

(self)

Source from the content-addressed store, hash-verified

174 raise val
175
176 def close(self):
177 """Raise GeneratorExit inside coroutine.
178 """
179 try:
180 self.throw(GeneratorExit)
181 except (GeneratorExit, StopIteration):
182 pass
183 else:
184 raise RuntimeError("coroutine ignored GeneratorExit")
185
186 @classmethod
187 def __subclasshook__(cls, C):

Callers 1

Calls 1

throwMethod · 0.95

Tested by

no test coverage detected