From 6f5dce342f503f91e3a4199e09b15fc614896fd1 Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 8 Jul 2016 07:01:48 -0400 Subject: [PATCH] Start going over Python 2.5 bytecode Fix 2.6 with bug --- test/add-test.py | 3 +- test/bytecode_2.5/00_assign.pyc | Bin 0 -> 178 bytes test/bytecode_2.5/00_import.pyc | Bin 0 -> 188 bytes test/bytecode_2.5/00_pass.pyc | Bin 0 -> 119 bytes test/bytecode_2.5/01_class.pyc | Bin 0 -> 448 bytes test/bytecode_2.5/01_list_comprehension.pyc | Bin 0 -> 363 bytes test/bytecode_2.5/02_def.pyc | Bin 0 -> 759 bytes test/bytecode_2.5/03_if_elif.pyc | Bin 0 -> 275 bytes test/bytecode_2.5/06_list_ifnot.pyc | Bin 0 -> 233 bytes test/bytecode_2.5/06_list_ifnot_and.pyc | Bin 0 -> 466 bytes test/bytecode_2.5/11-list-if.pyc | Bin 0 -> 367 bytes test/bytecode_2.6/05_with.pyc | Bin 0 -> 278 bytes test/simple_source/stmts/05_with.py | 1 + uncompyle6/parser.py | 7 ++-- uncompyle6/parsers/parse25.py | 42 ++++++++++++++++++++ uncompyle6/parsers/parse26.py | 9 ++++- 16 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 test/bytecode_2.5/00_assign.pyc create mode 100644 test/bytecode_2.5/00_import.pyc create mode 100644 test/bytecode_2.5/00_pass.pyc create mode 100644 test/bytecode_2.5/01_class.pyc create mode 100644 test/bytecode_2.5/01_list_comprehension.pyc create mode 100644 test/bytecode_2.5/02_def.pyc create mode 100644 test/bytecode_2.5/03_if_elif.pyc create mode 100644 test/bytecode_2.5/06_list_ifnot.pyc create mode 100644 test/bytecode_2.5/06_list_ifnot_and.pyc create mode 100644 test/bytecode_2.5/11-list-if.pyc create mode 100644 test/bytecode_2.6/05_with.pyc create mode 100644 uncompyle6/parsers/parse25.py diff --git a/test/add-test.py b/test/add-test.py index 85a64022..09ed8211 100755 --- a/test/add-test.py +++ b/test/add-test.py @@ -9,4 +9,5 @@ version = sys.version[0:3] cfile = "bytecode_%s/%s" % (version, short) + 'c' print("byte-compiling %s to %s" % (path, cfile)) py_compile.compile(path, cfile) -os.system("../bin/uncompyle6 -a -t %s" % cfile) +if sys.version >= (2, 6, 0): + os.system("../bin/uncompyle6 -a -t %s" % cfile) diff --git a/test/bytecode_2.5/00_assign.pyc b/test/bytecode_2.5/00_assign.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1ef8cd94e50d41304004cf078e610a4128c2c9c GIT binary patch literal 178 zcmdn|iI*$)tx$L}0~9aN|mqx3BUZj z)Jz>FAVUMhEdgmx3<44mW)fH+Spy`1Ac_@$+~UmKf}GU&;{4L00@; nF3Bw^);BPS2a4twmFN{z7IOeK+2rP@l;)(`fz1RN$ioN#ww)zs literal 0 HcmV?d00001 diff --git a/test/bytecode_2.5/00_pass.pyc b/test/bytecode_2.5/00_pass.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bde60dc2784566f6f0aabd2ce5155acf2573697b GIT binary patch literal 119 zcmdn|iI*$)tx$L}0~9aZ&1I1%fVAdpjoKsrgc7!+oFKn%6m4`KpH6zrxFP9V#*B0067Br`uR2qaFj Q9pC`8frO16+>^r00QzN1V*mgE literal 0 HcmV?d00001 diff --git a/test/bytecode_2.5/01_list_comprehension.pyc b/test/bytecode_2.5/01_list_comprehension.pyc new file mode 100644 index 0000000000000000000000000000000000000000..adb300b7215b1a6a33839bf5f45e4cacc8292726 GIT binary patch literal 363 zcmZ{eJxjzu5Qg7La-JWgFbI}c*n}%QPc20(tZl9kE`)Gohcl35lWeZA_9ywfZ0;90 z6M~1J3;WE+`_Als?!(jSD|*c_o)d{ra-9`yfnW`o37*psYXSpIh}ttG01dJSb0qTl zAbTns;4*6GNW9VFg98{JAM|6CmTV(jMC}TR4>AE(@l@U{NZ~1bMId;Im47M!3lo{> zbu3GkX+JC-%iDBJ?$Tae-KO4hEC~*9_foo|YD&(W-E}!Ha$7YWzj5sfTQ6>wSy{L~ a`_;W}-rcbbK2+B1N`4G=iT+_mSM&{CPdvW> literal 0 HcmV?d00001 diff --git a/test/bytecode_2.5/02_def.pyc b/test/bytecode_2.5/02_def.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cd98701ca37892b2a4013d8e962efb3fa91f52fe GIT binary patch literal 759 zcmb7?&uYRz5XNWS__wwPuf9M|^B3T0gms=BI=VCru% literal 0 HcmV?d00001 diff --git a/test/bytecode_2.5/03_if_elif.pyc b/test/bytecode_2.5/03_if_elif.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ab22f03a0d969677864320d2ae217be19270f26 GIT binary patch literal 275 zcmY*Su?oU45WTCF7R3%O(y?17E4Yg2;OgSgF-V(2plxa{9UNTz9Y_DnFYrMWQ;Z`JMaTaSdwZwen+}D qh0Mq{ma@%Os7lCMRqO6f?$oZ)Wnas^`<#{x0Y>O!fZ;S4IQG6nFfxh& literal 0 HcmV?d00001 diff --git a/test/bytecode_2.5/06_list_ifnot.pyc b/test/bytecode_2.5/06_list_ifnot.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8516184a6d19a6f33beb76ba12809394ba7bdde4 GIT binary patch literal 233 zcmYL?Jqp4=5QX2yD56;C0jyJqe}$EZg^i7kg^(bN#8CsuZge)FwMX&>UckF}0w*Fk z@V=Sh&ClcAYP_DyO^jdolIJ3x3XVYdr5`E~u-JAHdY}r(!(Ab7LXkKgI_EZ&C{hT0 z?16Qlz0^7%dJpM2fkr}$lp_iKh9FlE38@W4W07DwDk<-Eh#V%#wNjA;pU z*9ru*z(!#*zrZ>|8^J1><<_1%hN1}6kvn{{iI4?$yHKr?*1^jVit#RK5;7%;)6^5z zX;Ktg$6YSig&$=b>hta?X~@4?%4wU+Jn;!p6ZF!M=wKFR+~S$UKtG<%N&Zlpa$%a7 z6$1G&D{srXFxtCSlbTWL%DOSRsl0X7Xnd{<>q*Bl5EUODTUOFzL8I+PvA@} zcz0p``I%w9+4=k)55Ml`PZ^HSNWPJvvB(#YI7s3G@@NVEoFr73*OkTxGyahtjMR&dOP&u5oOgqO#q<9WRe8W7DT>3f}PpqBf zC0?-(`$z=6(1kd1Ra4r8{I<>PEb~><+QQc4d_9ZfY3YckZgbh}Sx-}DQlylmZBA!8 eu9w05e(B*<{2%`xOK2d3tIDsprM>R?ivIzgY)Xm% literal 0 HcmV?d00001 diff --git a/test/bytecode_2.6/05_with.pyc b/test/bytecode_2.6/05_with.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5845d4ce1ce82426ea4b0d8a6d733b0b8aa7d9af GIT binary patch literal 278 zcmYL@!AiqG5QhIvlhhUz@h*4_2#p@R74fF0f_kW=$WWRoE+%csOwf8!5FgN2@db3Y zEjSGS&d0DH^Zm2mKmB?i&#`yALA1!61*LO6HF2m zDLBRT&A5zk`(SaObxh!Ytukkm9$371eIn7Ra?J}JW!