Skip to content

Commit 8ee6d84

Browse files
committed
update the except* opcodes
1 parent 28ce9d2 commit 8ee6d84

File tree

4 files changed

+80
-260
lines changed

4 files changed

+80
-260
lines changed

Doc/library/dis.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -899,10 +899,9 @@ All of the following opcodes use their arguments.
899899
Performs exception matching for ``except*``. Applies ``split(TOS)`` on
900900
the exception group representing TOS1. Jumps if no match is found.
901901

902-
Pops one item from the stack. If a match was found, pops the 3 items representing
903-
the exception and pushes the 3 items representing the non-matching part of
904-
the exception group, followed by the 3 items representing the matching part.
905-
In other words, in case of a match it pops 4 items and pushes 6.
902+
Pops one item from the stack (the match type). If a match was found,
903+
next item (the exception) and pushes the non-matching part of the
904+
exception group followed by the matching part.
906905

907906
.. versionadded:: 3.11
908907

@@ -912,8 +911,8 @@ All of the following opcodes use their arguments.
912911
Combines the raised and reraised exceptions list from TOS, into an exception
913912
group to propagate from a try-except* block. Uses the original exception
914913
group from TOS1 to reconstruct the structure of reraised exceptions. Pops
915-
two items from the stack and pushes a triplet representing the exception to
916-
reraise or three ``None`` if there isn't one.
914+
two items from the stack and pushes 0 (for lasti, which is unused) followed
915+
by the exception to reraise or ``None`` if there isn't one.
917916

918917
.. versionadded:: 3.11
919918

0 commit comments

Comments
 (0)