8000 bpo-46841: Don't jump during `throw()` by brandtbucher · Pull Request #31968 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-46841: Don't jump during throw() #31968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean things up a bit
  • Loading branch information
brandtbucher committed Mar 17, 2022
commit acdf9848aa39a904f6322160e4bf87a01fcebaae
4 changes: 2 additions & 2 deletions Doc/library/dis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1276,10 +1276,10 @@ iterations of the loop.

Equivalent to ``TOS = TOS1.send(TOS)``. Used in ``yield from`` and ``await``
statements.

If the call raises :exc:`StopIteration`, pop both values, push its return
value, and increment the bytecode counter by *delta*.

If TOS1 is ``NULL`` (set when it raises :exc:`StopIteration` during a
``throw()`` through the current frame), pop both values, push TOS (its
return value), and increment the bytecode counter by *delta*.
Expand Down
3 changes: 1 addition & 2 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -2536,8 +2536,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
PyObject *v = POP();
PyObject *receiver = TOP();
if (receiver == NULL) {
// Receiver completed during a throw() call. v is the return
// value:
// Receiver returned during a throw(). v is its return value:
SET_TOP(v);
JUMPBY(oparg);
DISPATCH();
Expand Down
0