summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2022-04-01 12:59:38 (GMT)
committerGitHub <noreply@github.com>2022-04-01 12:59:38 (GMT)
commit04e07c258f4f2ac85e25355242a113f98a706f04 (patch)
tree166df77e0d1e0bbaf6c4fcd8b1f3584010cf6c26 /Doc
parentae9de82e321581e1906c6ef2a7ad83ab30ae3325 (diff)
downloadcpython-04e07c258f4f2ac85e25355242a113f98a706f04.zip
cpython-04e07c258f4f2ac85e25355242a113f98a706f04.tar.gz
cpython-04e07c258f4f2ac85e25355242a113f98a706f04.tar.bz2
bpo-47186: Replace JUMP_IF_NOT_EXC_MATCH by CHECK_EXC_MATCH + jump (GH-32231)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/dis.rst18
-rw-r--r--Doc/whatsnew/3.11.rst3
2 files changed, 8 insertions, 13 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index d1a0cec..b364e3f 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -628,6 +628,12 @@ iterations of the loop.
.. versionadded:: 3.11
+.. opcode:: CHECK_EXC_MATCH
+
+ Performs exception matching for ``except``. Tests whether the TOS1 is an exception
+ matching TOS. Pops TOS and pushes the boolean result of the test.
+
+ .. versionadded:: 3.11
.. opcode:: WITH_EXCEPT_START
@@ -916,18 +922,6 @@ iterations of the loop.
.. versionadded:: 3.1
-.. opcode:: JUMP_IF_NOT_EXC_MATCH (target)
-
- Performs exception matching for ``except``.
- Tests whether the second value on the stack is an exception matching TOS,
- and jumps if it is not. Pops one value from the stack.
-
- .. versionadded:: 3.9
-
- .. versionchanged:: 3.11
- This opcode no longer pops the active exception.
-
-
.. opcode:: JUMP_IF_NOT_EG_MATCH (target)
Performs exception matching for ``except*``. Applies ``split(TOS)`` on
diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index 1580867..dc2d4b0 100644
--- a/Doc/whatsnew/3.11.rst
+++ b/Doc/whatsnew/3.11.rst
@@ -520,7 +520,8 @@ CPython bytecode changes
* Add :opcode:`POP_JUMP_IF_NOT_NONE` and :opcode:`POP_JUMP_IF_NONE` opcodes to
speed up conditional jumps.
-* :opcode:`JUMP_IF_NOT_EXC_MATCH` no longer pops the active exception.
+* Replaced :opcode:`JUMP_IF_NOT_EXC_MATCH` by :opcode:`CHECK_EXC_MATCH` which
+ performs the check but does not jump.
* Replaced :opcode:`JUMP_ABSOLUTE` by the relative :opcode:`JUMP_BACKWARD`.