fix test_dis

This commit is contained in:
Kumar Aditya 2025-12-17 15:15:11 +05:30
parent dcf8950933
commit 1c40a6fdae

View file

@ -827,7 +827,14 @@ Disassembly of <code object foo at 0x..., file "%s", line %d>:
%4d RESUME 0
%4d LOAD_GLOBAL 1 (list + NULL)
%4d LOAD_GLOBAL 0 (list)
COPY 1
LOAD_COMMON_CONSTANT 5 (list)
IS_OP 0 (is)
POP_JUMP_IF_FALSE 22 (to L3)
NOT_TAKEN
POP_TOP
BUILD_LIST 0
LOAD_FAST_BORROW 0 (x)
BUILD_TUPLE 1
LOAD_CONST %d (<code object <genexpr> at 0x..., file "%s", line %d>)
@ -835,6 +842,21 @@ Disassembly of <code object foo at 0x..., file "%s", line %d>:
SET_FUNCTION_ATTRIBUTE 8 (closure)
LOAD_DEREF 1 (y)
CALL 0
PUSH_NULL
L1: FOR_ITER 3 (to L2)
LIST_APPEND 3
JUMP_BACKWARD 5 (to L1)
L2: END_FOR
POP_ITER
RETURN_VALUE
L3: PUSH_NULL
LOAD_FAST_BORROW 0 (x)
BUILD_TUPLE 1
LOAD_CONST 1 (<code object <genexpr> at 0x..., file "%s", line %d>)
MAKE_FUNCTION
SET_FUNCTION_ATTRIBUTE 8 (closure)
LOAD_DEREF 1 (y)
CALL 0
CALL 1
RETURN_VALUE
""" % (dis_nested_0,
@ -845,6 +867,8 @@ Disassembly of <code object foo at 0x..., file "%s", line %d>:
1 if __debug__ else 0,
__file__,
_h.__code__.co_firstlineno + 3,
__file__,
_h.__code__.co_firstlineno + 3,
)
dis_nested_2 = """%s