aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test__opcode.py
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-10-27 03:55:03 -0700
committerGitHub <noreply@github.com>2022-10-27 11:55:03 +0100
commit22863df7ca5f9cd01a40ab3dce3d067ec5666081 (patch)
tree73c460d80f41b45a331b7d886defe39127e12472 /Lib/test/test__opcode.py
parente60892f9db1316dbabf7a652d7648e4f968b745d (diff)
downloadcpython-22863df7ca5f9cd01a40ab3dce3d067ec5666081.tar.gz
cpython-22863df7ca5f9cd01a40ab3dce3d067ec5666081.zip
GH-96793: Change `FOR_ITER` to not pop the iterator on exhaustion. (GH-96801)
Change FOR_ITER to have the same stack effect regardless of whether it branches or not. Performance is unchanged as FOR_ITER (and specialized forms jump over the cleanup code).
Diffstat (limited to 'Lib/test/test__opcode.py')
-rw-r--r--Lib/test/test__opcode.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test__opcode.py b/Lib/test/test__opcode.py
index f548e3647b3..704d19fffd0 100644
--- a/Lib/test/test__opcode.py
+++ b/Lib/test/test__opcode.py
@@ -40,7 +40,7 @@ class OpcodeTests(unittest.TestCase):
self.assertEqual(stack_effect(JUMP_IF_TRUE_OR_POP, 0, jump=False), -1)
FOR_ITER = dis.opmap['FOR_ITER']
self.assertEqual(stack_effect(FOR_ITER, 0), 1)
- self.assertEqual(stack_effect(FOR_ITER, 0, jump=True), -1)
+ self.assertEqual(stack_effect(FOR_ITER, 0, jump=True), 1)
self.assertEqual(stack_effect(FOR_ITER, 0, jump=False), 1)
JUMP_FORWARD = dis.opmap['JUMP_FORWARD']
self.assertEqual(stack_effect(JUMP_FORWARD, 0), 0)