1- # Copyright (c) 2015-2024 by Rocky Bernstein
1+ # Copyright (c) 2015-2025 by Rocky Bernstein
22# Copyright (c) 2005 by Dan Pascu <dan@windowmaker.org>
33# Copyright (c) 2000-2002 by hartmut Goebel <h.goebel@crazy-compilers.com>
44#
3939from sys import intern
4040
4141from xdis import code2num , instruction_size , iscode , op_has_argument
42- from xdis .bytecode import _get_const_info
42+ from xdis .bytecode import _get_const_info , get_optype
4343
4444from uncompyle6 .scanner import Scanner , Token
4545
@@ -304,6 +304,7 @@ def ingest(self, co, classname=None, code_objects={}, show_asm=None):
304304
305305 op = self .code [offset ]
306306 op_name = self .op_name (op )
307+ op_type = get_optype (op , self .opc )
307308
308309 oparg = None
309310 pattr = None
@@ -470,7 +471,15 @@ def ingest(self, co, classname=None, code_objects={}, show_asm=None):
470471 if offset not in replace :
471472 new_tokens .append (
472473 Token (
473- op_name , oparg , pattr , offset , linestart , op , has_arg , self .opc
474+ op_name ,
475+ oparg ,
476+ pattr ,
477+ offset ,
478+ linestart ,
479+ op ,
480+ has_arg ,
481+ self .opc ,
482+ optype = op_type ,
474483 )
475484 )
476485 else :
@@ -484,6 +493,7 @@ def ingest(self, co, classname=None, code_objects={}, show_asm=None):
484493 op ,
485494 has_arg ,
486495 self .opc ,
496+ optype = op_type ,
487497 )
488498 )
489499 pass
0 commit comments