From 154dabfcef84b7ebcaed5f13beb084b075ba2276 Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 14 Jan 2023 09:42:16 -0500 Subject: [PATCH] Handle Python 3.4 MAKE_CLOSURE fns ... Is done just like Python 3.3 --- test/bytecode_3.3_run/02_make_closure.pyc | Bin 0 -> 1005 bytes test/bytecode_3.4_run/02_make_closure.pyc | Bin 0 -> 722 bytes test/simple_source/bug34/02_make_closure.py | 18 ++++++++++++++++ uncompyle6/parsers/parse3.py | 22 ++++++++++++-------- 4 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 test/bytecode_3.3_run/02_make_closure.pyc create mode 100644 test/bytecode_3.4_run/02_make_closure.pyc create mode 100644 test/simple_source/bug34/02_make_closure.py diff --git a/test/bytecode_3.3_run/02_make_closure.pyc b/test/bytecode_3.3_run/02_make_closure.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0828c6cb8020d4ff21ce11758064a83270af1072 GIT binary patch literal 1005 zcmb7CO>Yx15FPJswjXLK5<=pH$_4EKT2we91ga`d^wJzqF4o5DrrYessl9_h%84S7 zIQ19sSCIH+ym1oIpj_%*kH_Qj%zHEbwX?f@^ZSqasfY~S8Y%R*nBfYdA{sy{8Yp^S zB~+#K4f~X?6B;CBVace<<2ECk(Pd98=U`Gx}08Ir4 z^8Fw>hcPm_N$ERIdty8*GF;<5h!5r19yczqw|yJBLV~hXrLvz`G7XLFWXLMVvW906 z9nm$>r4p%TN^t0eX856`)MZft63HmBP75KzA_7mX=S^r@*OR)_dNpgzT^5py1*{Zg z)gwmatr)>HWe8dq*bqMz_qv@nRtLx4*ux=@UcNefaim+Y)n-ojVESbxzeEZGh}5py z!pD!G|5u-bCE7wdu(&@dTMPW#uxQ=7iji6KPTXE`*(}au-8vuX44rFMvd`JfLp08m z&63U3+J@pXZUwRhQ<^TWy literal 0 HcmV?d00001 diff --git a/test/bytecode_3.4_run/02_make_closure.pyc b/test/bytecode_3.4_run/02_make_closure.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5cfb04469d177b07815a77b21234f70173b344fd GIT binary patch literal 722 zcmZ8dJ#W-N5S{Vbz7H;>KuA<5G)R`VApa@ZsCRdrI zH2_7h=8uVjHV%YKO9?#45}&wkrLFH1Rm-X+vXaxr3?B1L`B<8~5;ODzqN2{7Bl-%z z@4Kp5)ta2?Y@v5&-TcYk?xV-luy=kI%#T;^t&C#8$MqQiw{XDw?9P8Jj{myIQgO7* z8%^YgM2#ssu0no9blT^J`gmqc9SYbX=MIpem1_2efJ~^z#|arlAr2i)4zix_ z5tXLk#^p)4^Y|`Y` 0: rule = ( "mkfunc_annotate ::= %s%s%sannotate_tuple load_closure LOAD_CODE LOAD_STR %s" @@ -1195,8 +1197,10 @@ class Python3Parser(PythonParser): "pos_arg " * args_pos, opname, ) + self.add_unique_rule(rule, opname, token.attr, customize) - elif self.version >= (3, 4): + + if self.version >= (3, 4): if not self.is_pypy: load_op = "LOAD_STR" else: @@ -1221,7 +1225,7 @@ class Python3Parser(PythonParser): opname, ) - self.add_unique_rule(rule, opname, token.attr, customize) + self.add_unique_rule(rule, opname, token.attr, customize) if args_kw == 0: rule = "mkfunc ::= %sload_closure load_genexpr %s" % (