From 8e15246951d2910c82f1a2d7dc2b404e5393a2ca Mon Sep 17 00:00:00 2001 From: rocky Date: Thu, 14 Dec 2017 09:50:06 -0500 Subject: [PATCH] Add 3.6 withas rule --- test/bytecode_3.6/04_withas.pyc | Bin 0 -> 472 bytes uncompyle6/parsers/parse36.py | 8 ++++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 test/bytecode_3.6/04_withas.pyc diff --git a/test/bytecode_3.6/04_withas.pyc b/test/bytecode_3.6/04_withas.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1d9b0dd7ba246a3f8933a22454307a76d47beed6 GIT binary patch literal 472 zcmYjN%TB^T6uoz78zkT>tX#QmV#Gw3#*nC65@DffOi1YrSfMSMDFR7Zl|5U3!C#uK zD}KS1cZLN_a_%E@ALrcLMx!=f`@uH@_=ST)YdHlx5JoDwXfHU$NILXIVF zt`G_=SP4a?gpzH}-`UDpxg0sW0EAcKy5qc$Ec;4lYnW~cq#~$?N(q^F!&nKW&jKN{ zr}!&Yah5(ynMvQ1<|^7tg~|oj7-}47TxeYG6-z@`*LM2)gW2eWa%H#!*0G85n4*r) atTvk*^xC`G0oD5??~tL{JHcVVOe literal 0 HcmV?d00001 diff --git a/uncompyle6/parsers/parse36.py b/uncompyle6/parsers/parse36.py index 9d1e6ec1..3117b0f7 100644 --- a/uncompyle6/parsers/parse36.py +++ b/uncompyle6/parsers/parse36.py @@ -118,8 +118,12 @@ class Python36Parser(Python35Parser): self.addRule(rule, nop_func) elif opname == 'SETUP_WITH': rules_str = """ - withstmt ::= expr SETUP_WITH POP_TOP suite_stmts_opt POP_BLOCK LOAD_CONST - WITH_CLEANUP_START WITH_CLEANUP_FINISH END_FINALLY + withstmt ::= expr SETUP_WITH POP_TOP suite_stmts_opt POP_BLOCK LOAD_CONST + WITH_CLEANUP_START WITH_CLEANUP_FINISH END_FINALLY + + # Removes POP_BLOCK LOAD_CONST from 3.6- + withasstmt ::= expr SETUP_WITH store suite_stmts_opt COME_FROM_WITH + WITH_CLEANUP_START WITH_CLEANUP_FINISH END_FINALLY """ self.addRule(rules_str, nop_func)