def _leak_stopiteration(self, e): # turn a leaking StopIteration into RuntimeError (with its cause set # appropriately). space = self.space e2 = OperationError(space.w_RuntimeError, space.newtext("%s raised StopIteration" % self.KIND)) e2.chain_exceptions_from_cause(space, e) raise e2
def _leak_stopasynciteration(self, e): space = self.space e2 = OperationError(space.w_RuntimeError, space.newtext("async generator raised StopAsyncIteration")) e2.chain_exceptions_from_cause(space, e) raise e2