diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-12-13 12:00:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-13 12:00:21 (GMT) |
commit | 428c9812cb4ff3521e5904719224fe63fba5370a (patch) | |
tree | 65335e5e53acffbc42c71a1ba52616e022abe13a /Lib/test/test_code.py | |
parent | 3531ea441b8b76bff90d2ecc062335da65fd3341 (diff) | |
download | cpython-428c9812cb4ff3521e5904719224fe63fba5370a.zip cpython-428c9812cb4ff3521e5904719224fe63fba5370a.tar.gz cpython-428c9812cb4ff3521e5904719224fe63fba5370a.tar.bz2 |
gh-112962: in dis module, put cache information in the Instruction instead of creating fake Instructions to represent it (#113016)
Diffstat (limited to 'Lib/test/test_code.py')
-rw-r--r-- | Lib/test/test_code.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py index a961ddb..d8fb826 100644 --- a/Lib/test/test_code.py +++ b/Lib/test/test_code.py @@ -144,6 +144,8 @@ from test.support import (cpython_only, gc_collect) from test.support.script_helper import assert_python_ok from test.support import threading_helper +from test.support.bytecode_helper import (BytecodeTestCase, + instructions_with_positions) from opcode import opmap, opname COPY_FREE_VARS = opmap['COPY_FREE_VARS'] @@ -384,10 +386,8 @@ class CodeTest(unittest.TestCase): code = traceback.tb_frame.f_code artificial_instructions = [] - for instr, positions in zip( - dis.get_instructions(code, show_caches=True), - code.co_positions(), - strict=True + for instr, positions in instructions_with_positions( + dis.get_instructions(code), code.co_positions() ): # If any of the positions is None, then all have to # be None as well for the case above. There are still |