コード例 #1
0
 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
コード例 #2
0
 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