Author: Armin Rigo <ar...@tunes.org>
Branch: py3.5-corowrapper
Changeset: r87144:fe2ec186aa1c
Date: 2016-09-16 17:51 +0200
http://bitbucket.org/pypy/pypy/changeset/fe2ec186aa1c/

Log:    fix

diff --git a/pypy/interpreter/generator.py b/pypy/interpreter/generator.py
--- a/pypy/interpreter/generator.py
+++ b/pypy/interpreter/generator.py
@@ -124,6 +124,7 @@
                 raise OperationError(space.w_StopIteration,
                                      space.newtuple([w_result]))
         else:
+            assert w_result is not None
             return w_result     # YIELDed
 
     def _invoke_execute_frame(self, frame, w_arg_or_err):
@@ -151,10 +152,14 @@
         # interpretation.
         space = self.space
         if self.w_yielded_from is not None:
-            w_arg_or_err = self.next_yield_from(frame, w_arg_or_err)
+            self.next_yield_from(frame, w_arg_or_err)
             # Normal case: the call above raises Yield.
             # We reach this point if the iterable is exhausted.
-        elif isinstance(w_arg_or_err, SApplicationException):
+            last_instr = jit.promote(frame.last_instr)
+            assert last_instr >= 0
+            return last_instr + 1
+
+        if isinstance(w_arg_or_err, SApplicationException):
             ec = space.getexecutioncontext()
             return frame.handle_operation_error(ec, w_arg_or_err.operr)
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to