@@ -577,7 +577,9 @@ def _assemble_locations(
577577
578578 _ , size , lineno , old_location = next (iter_in )
579579 # Infer the line if location is None
580- old_location = old_location or InstrLocation (lineno , None , None , None )
580+ old_location = old_location or InstrLocation ._from_tuple (
581+ lineno , None , None , None
582+ )
581583 lineno = first_lineno
582584
583585 # We track the last set lineno to be able to compute deltas
@@ -932,14 +934,18 @@ def to_bytecode(
932934 else :
933935 arg = c_arg
934936
935- location = c_instr .location or InstrLocation (lineno , None , None , None )
937+ location = c_instr .location or InstrLocation ._from_tuple (
938+ lineno , None , None , None
939+ )
936940
937941 if jump_target is not None :
938942 arg = PLACEHOLDER_LABEL
939943 instr_index = len (instructions )
940944 jumps .append ((instr_index , jump_target ))
941945
942- instructions .append (Instr (c_instr .name , arg , location = location ))
946+ instructions .append (
947+ Instr ._from_trusted (c_instr ._name , c_instr ._opcode , arg , location )
948+ )
943949
944950 # We now insert the TryEnd entries
945951 if current_instr_offset in ex_end :
@@ -1032,7 +1038,9 @@ def add(names: list[str], name: str) -> int:
10321038 return index
10331039
10341040 def concrete_instructions (self ) -> None :
1035- location = InstrLocation (self .bytecode .first_lineno , None , None , None )
1041+ location = InstrLocation ._from_tuple (
1042+ self .bytecode .first_lineno , None , None , None
1043+ )
10361044 # Track instruction (index) using cell vars and free vars to be able to update
10371045 # the index used once all the names are known.
10381046 cell_instrs : list [int ] = []
@@ -1088,7 +1096,7 @@ def concrete_instructions(self) -> None:
10881096 continue
10891097
10901098 if isinstance (instr , SetLineno ):
1091- location = InstrLocation (instr .lineno , None , None , None )
1099+ location = InstrLocation . _from_tuple (instr .lineno , None , None , None )
10921100 continue
10931101
10941102 if isinstance (instr , TryBegin ):
0 commit comments