From b99f196d18045761a1f25e979bd9936b4de3afa0 Mon Sep 17 00:00:00 2001 From: rocky Date: Tue, 12 Jul 2016 09:46:46 -0400 Subject: [PATCH] Better 3.2/33 store_locals handling --- test/bytecode_3.3/05_store_locals.pyc | Bin 0 -> 649 bytes .../{05_store_name.py => 05_store_locals.py} | 0 uncompyle6/semantics/pysource.py | 9 +++++++-- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 test/bytecode_3.3/05_store_locals.pyc rename test/simple_source/bug33/{05_store_name.py => 05_store_locals.py} (100%) diff --git a/test/bytecode_3.3/05_store_locals.pyc b/test/bytecode_3.3/05_store_locals.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27cd578fd2fab983461393dd119f182d8fb5d82f GIT binary patch literal 649 zcmbVJO-lnY5S?`E2c@F;3p~l!6C9J!#E@Yd!**OT_?Ct!Sc1J(L|P6Ix(9A*1Lk zp$T@nG){K_uV9pdk$4yGiJR7%LUI|hc3?L!e**VObZ&?k0>t}p zcg9!KnQ4jyi40kV?-u3-28MB{oTbPp6#&bDH};kH5WKnCJUY)J)EBum5r~ZVRQ9TR zZjJVio5BoVcsd#l&o8uZU1PL$xZwx$kMOWE$Pr;)9z=={;a4ID@i<${*Ls%MMr-Z? zrgiN~MkUStkiK(nm*>*8csq76;$v~G|0h^vuB1sHg5)E$)z>WcOUk$5(>DHZ3%HgL RqQ5jwbX>-#UrC{*j$gt^g|Ywu literal 0 HcmV?d00001 diff --git a/test/simple_source/bug33/05_store_name.py b/test/simple_source/bug33/05_store_locals.py similarity index 100% rename from test/simple_source/bug33/05_store_name.py rename to test/simple_source/bug33/05_store_locals.py diff --git a/uncompyle6/semantics/pysource.py b/uncompyle6/semantics/pysource.py index f16e4b7a..381c7a79 100644 --- a/uncompyle6/semantics/pysource.py +++ b/uncompyle6/semantics/pysource.py @@ -1962,11 +1962,16 @@ class SourceWalker(GenericASTTraversal, object): code._tokens = None # save memory assert ast == 'stmts' + if 3.0 <= self.version <= 3.3: + try: + if ast[0][0][0] == 'store_locals': + if self.hide_internal: del ast[0] + except: + pass + try: if ast[0][0] == NAME_MODULE: if self.hide_internal: del ast[0] - elif ast[1][0] == NAME_MODULE: - if self.hide_internal: del ast[1] pass except: pass