From d371839c992cda567112b3ce132e29bb42615f1f Mon Sep 17 00:00:00 2001 From: rocky Date: Wed, 19 Jun 2019 15:38:58 -0400 Subject: [PATCH] A few more LOAD_CONST->LOAD_CODE --- uncompyle6/parsers/parse3.py | 12 ++++++------ uncompyle6/parsers/parse32.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/uncompyle6/parsers/parse3.py b/uncompyle6/parsers/parse3.py index 0dbe733e..aace44a9 100644 --- a/uncompyle6/parsers/parse3.py +++ b/uncompyle6/parsers/parse3.py @@ -1230,7 +1230,7 @@ class Python3Parser(PythonParser): if re.search("^MAKE_FUNCTION.*_A", opname): if self.version >= 3.6: rule = ( - "mkfunc_annotate ::= %s%sannotate_tuple LOAD_CONST LOAD_STR %s" + "mkfunc_annotate ::= %s%sannotate_tuple LOAD_CODE LOAD_STR %s" % ( ("pos_arg " * (args_pos)), ("call " * (annotate_args - 1)), @@ -1239,7 +1239,7 @@ class Python3Parser(PythonParser): ) self.add_unique_rule(rule, opname, token.attr, customize) rule = ( - "mkfunc_annotate ::= %s%sannotate_tuple LOAD_CONST LOAD_STR %s" + "mkfunc_annotate ::= %s%sannotate_tuple LOAD_CODE LOAD_STR %s" % ( ("pos_arg " * (args_pos)), ("annotate_arg " * (annotate_args - 1)), @@ -1263,7 +1263,7 @@ class Python3Parser(PythonParser): ("kwargs " * args_kw), ) rule = ( - "mkfunc_annotate ::= %s%s%sannotate_tuple LOAD_CONST LOAD_STR EXTENDED_ARG %s" + "mkfunc_annotate ::= %s%s%sannotate_tuple LOAD_CODE LOAD_STR EXTENDED_ARG %s" % ( pos_kw_tuple[0], pos_kw_tuple[1], @@ -1273,7 +1273,7 @@ class Python3Parser(PythonParser): ) self.add_unique_rule(rule, opname, token.attr, customize) rule = ( - "mkfunc_annotate ::= %s%s%sannotate_tuple LOAD_CONST LOAD_STR EXTENDED_ARG %s" + "mkfunc_annotate ::= %s%s%sannotate_tuple LOAD_CODE LOAD_STR EXTENDED_ARG %s" % ( pos_kw_tuple[0], pos_kw_tuple[1], @@ -1284,7 +1284,7 @@ class Python3Parser(PythonParser): else: # See above comment about use of EXTENDED_ARG rule = ( - "mkfunc_annotate ::= %s%s%sannotate_tuple LOAD_CONST EXTENDED_ARG %s" + "mkfunc_annotate ::= %s%s%sannotate_tuple LOAD_CODE EXTENDED_ARG %s" % ( ("kwargs " * args_kw), ("pos_arg " * (args_pos)), @@ -1294,7 +1294,7 @@ class Python3Parser(PythonParser): ) self.add_unique_rule(rule, opname, token.attr, customize) rule = ( - "mkfunc_annotate ::= %s%s%sannotate_tuple LOAD_CONST EXTENDED_ARG %s" + "mkfunc_annotate ::= %s%s%sannotate_tuple LOAD_CODE EXTENDED_ARG %s" % ( ("kwargs " * args_kw), ("pos_arg " * (args_pos)), diff --git a/uncompyle6/parsers/parse32.py b/uncompyle6/parsers/parse32.py index 790951ea..ea18dbba 100644 --- a/uncompyle6/parsers/parse32.py +++ b/uncompyle6/parsers/parse32.py @@ -75,7 +75,7 @@ class Python32Parser(Python3Parser): args_pos, args_kw, annotate_args = token.attr # Check that there are 2 annotated params? rule = (('mkfunc_annotate ::= %s%sannotate_tuple ' - 'LOAD_CONST LOAD_CONST EXTENDED_ARG %s') % + 'LOAD_CONST LOAD_CODE EXTENDED_ARG %s') % (('pos_arg ' * (args_pos)), ('annotate_arg ' * (annotate_args-1)), opname)) self.add_unique_rule(rule, opname, token.attr, customize)