@@ -293,20 +293,21 @@ def tokens_append(j, token):
293
293
# but the operator and operand properties come from the other
294
294
# instruction
295
295
self .insts [i ] = Instruction (
296
- jump_inst .opname ,
297
- jump_inst .opcode ,
298
- jump_inst .optype ,
299
- jump_inst .inst_size ,
300
- jump_inst .arg ,
301
- jump_inst .argval ,
302
- jump_inst .argrepr ,
303
- jump_inst .has_arg ,
304
- inst .offset ,
305
- inst .starts_line ,
306
- inst .is_jump_target ,
307
- inst .has_extended_arg ,
308
- None ,
309
- None ,
296
+ opcode = jump_inst .opcode ,
297
+ opname = jump_inst .opname ,
298
+ arg = jump_inst .arg ,
299
+ argval = jump_inst .argval ,
300
+ argrepr = jump_inst .argrepr ,
301
+ offset = inst .offset ,
302
+ starts_line = inst .starts_line ,
303
+ is_jump_target = inst .is_jump_target ,
304
+ positions = None ,
305
+ optype = jump_inst .optype ,
306
+ has_arg = jump_inst .has_arg ,
307
+ inst_size = jump_inst .inst_size ,
308
+ has_extended_arg = inst .has_extended_arg ,
309
+ tos_str = None ,
310
+ start_offset = None ,
310
311
)
311
312
312
313
# Get jump targets
@@ -939,7 +940,7 @@ def next_except_jump(self, start):
939
940
if __name__ == "__main__" :
940
941
from xdis .version_info import PYTHON_VERSION_TRIPLE , version_tuple_to_str
941
942
942
- if PYTHON_VERSION_TRIPLE [:2 ] == (3 , 7 ):
943
+ if ( 3 , 7 ) <= PYTHON_VERSION_TRIPLE [:2 ] < (3 , 9 ):
943
944
import inspect
944
945
945
946
co = inspect .currentframe ().f_code # type: ignore
@@ -948,5 +949,8 @@ def next_except_jump(self, start):
948
949
for t in tokens :
949
950
print (t )
950
951
else :
951
- print (f"Need to be Python 3.7 to demo; I am version { version_tuple_to_str ()} ." )
952
+ print (
953
+ "Need to be Python 3.7..3.8 to demo; "
954
+ f"I am version { version_tuple_to_str ()} ."
955
+ )
952
956
pass
0 commit comments