Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test CALL_INTRINSIC_2 arg name with less hardcoded bytecode
  • Loading branch information
jkchandalia committed May 2, 2023
commit f034688b7fc2f7051ecf585777c4d0c3698ba8b3
40 changes: 2 additions & 38 deletions Lib/test/test_dis.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,43 +275,6 @@ def wrap_func_w_kwargs():
CALL_INTRINSIC_1 6 (INTRINSIC_LIST_TO_TUPLE)
RETURN_VALUE
"""
dis_intrinsic_2_1 = """\
0 RESUME 0

1 RETURN_CONST 0 (None)
PUSH_EXC_INFO

2 BUILD_LIST 0
COPY 2
LOAD_NAME 0 (Exception)
CHECK_EG_MATCH
COPY 1
POP_JUMP_IF_NONE 8 (to 34)
POP_TOP
LOAD_NAME 1 (x)
POP_TOP
JUMP_FORWARD 3 (to 32)
>> LIST_APPEND 3
POP_TOP
JUMP_FORWARD 2 (to 36)
>> JUMP_FORWARD 1 (to 36)
>> POP_TOP
>> LIST_APPEND 1
CALL_INTRINSIC_2 1 (INTRINSIC_PREP_RERAISE_STAR)
COPY 1
POP_JUMP_IF_NOT_NONE 3 (to 50)
POP_TOP
POP_EXCEPT
RETURN_CONST 0 (None)
>> SWAP 2
POP_EXCEPT
RERAISE 0
>> COPY 3
POP_EXCEPT
RERAISE 1
ExceptionTable:
3 rows
"""

_BIG_LINENO_FORMAT = """\
1 RESUME 0
Expand Down Expand Up @@ -1015,7 +978,8 @@ def test_intrinsic_1(self):
self.do_disassembly_test("(*a,)", dis_intrinsic_1_6)

def test_intrinsic_2(self):
self.do_disassembly_test("try: pass\nexcept* Exception: x", dis_intrinsic_2_1)
assert "CALL_INTRINSIC_2 1 (INTRINSIC_PREP_RERAISE_STAR)" \
Comment thread
JelleZijlstra marked this conversation as resolved.
Outdated
in self.get_disassembly("try: pass\nexcept* Exception: x")

def test_big_linenos(self):
def func(count):
Expand Down