summaryrefslogtreecommitdiff
path: root/Lib/test/test_compile.py
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2020-12-15 11:07:50 +0000
committerGitHub <noreply@github.com>2020-12-15 11:07:50 +0000
commit8473cf89bdbf2cb292b39c972db540504669b9cd (patch)
tree68e19e5056b75e3e86d8bc13b7ac6c214fb83ea6 /Lib/test/test_compile.py
parent6f79e60b66dacefca147bdaa80eb37f936a72991 (diff)
downloadcpython-git-8473cf89bdbf2cb292b39c972db540504669b9cd.tar.gz
bpo-42246: Remove DO_NOT_EMIT_BYTECODE macros, so that while loops and if statements conform to PEP 626. (GH-23743)
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r--Lib/test/test_compile.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index 0d11ce940f..3a37b6cf30 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -728,10 +728,10 @@ if 1:
for func in funcs:
opcodes = list(dis.get_instructions(func))
- self.assertEqual(2, len(opcodes))
- self.assertEqual('LOAD_CONST', opcodes[0].opname)
- self.assertEqual(None, opcodes[0].argval)
- self.assertEqual('RETURN_VALUE', opcodes[1].opname)
+ self.assertLessEqual(len(opcodes), 3)
+ self.assertEqual('LOAD_CONST', opcodes[-2].opname)
+ self.assertEqual(None, opcodes[-2].argval)
+ self.assertEqual('RETURN_VALUE', opcodes[-1].opname)
def test_false_while_loop(self):
def break_in_while():