You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Add 3.6 withas rule
This commit is contained in:
BIN
test/bytecode_3.6/04_withas.pyc
Normal file
BIN
test/bytecode_3.6/04_withas.pyc
Normal file
Binary file not shown.
@@ -118,8 +118,12 @@ class Python36Parser(Python35Parser):
|
|||||||
self.addRule(rule, nop_func)
|
self.addRule(rule, nop_func)
|
||||||
elif opname == 'SETUP_WITH':
|
elif opname == 'SETUP_WITH':
|
||||||
rules_str = """
|
rules_str = """
|
||||||
withstmt ::= expr SETUP_WITH POP_TOP suite_stmts_opt POP_BLOCK LOAD_CONST
|
withstmt ::= expr SETUP_WITH POP_TOP suite_stmts_opt POP_BLOCK LOAD_CONST
|
||||||
WITH_CLEANUP_START WITH_CLEANUP_FINISH END_FINALLY
|
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)
|
self.addRule(rules_str, nop_func)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user