diff --git a/test/bytecode_3.2/01_delete_deref.pyc b/test/bytecode_3.2/01_delete_deref.pyc new file mode 100644 index 00000000..15184309 Binary files /dev/null and b/test/bytecode_3.2/01_delete_deref.pyc differ diff --git a/test/simple_source/bug33/01_delete_deref.py b/test/simple_source/bug33/01_delete_deref.py new file mode 100644 index 00000000..3f698c16 --- /dev/null +++ b/test/simple_source/bug33/01_delete_deref.py @@ -0,0 +1,4 @@ +def a(): + del y + def b(): + return y diff --git a/uncompyle6/parsers/parse32.py b/uncompyle6/parsers/parse32.py index b9610664..258833de 100644 --- a/uncompyle6/parsers/parse32.py +++ b/uncompyle6/parsers/parse32.py @@ -24,6 +24,9 @@ class Python32Parser(Python3Parser): # JUMP_FORWARD in some cases, and hence we also don't # see COME_FROM _ifstmts_jump ::= c_stmts_opt + + stmt ::= del_deref_stmt + del_deref_stmt ::= DELETE_DEREF """ pass diff --git a/uncompyle6/semantics/pysource.py b/uncompyle6/semantics/pysource.py index 0fbf0e55..46647873 100644 --- a/uncompyle6/semantics/pysource.py +++ b/uncompyle6/semantics/pysource.py @@ -204,11 +204,17 @@ class SourceWalker(GenericASTTraversal, object): 'raise_stmt2': ( '%|raise %c, %c\n', 0, 1), }) else: - # Gotta love Python for its futzing around with syntax like this TABLE_DIRECT.update({ - 'raise_stmt2': ( '%|raise %c from %c\n', 0, 1), + # Gotta love Python for its futzing around with syntax like this + 'raise_stmt2': ( '%|raise %c from %c\n', 0, 1), }) + if version >= 3.2: + TABLE_DIRECT.update({ + 'del_deref_stmt': ( '%|del %c\n', 0), + 'DELETE_DEREF': ( '%{pattr}', 0 ), + }) + if version < 2.0: TABLE_DIRECT.update({ 'importlist': ( '%C', (0, maxint, ', ') ),