You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Adapt for recent options changes in
-T option structure changed.
This commit is contained in:
@@ -136,7 +136,8 @@ def main_bin():
|
|||||||
elif opt in ('--tree+', '-T'):
|
elif opt in ('--tree+', '-T'):
|
||||||
if 'showast' not in options:
|
if 'showast' not in options:
|
||||||
options['showast'] = {}
|
options['showast'] = {}
|
||||||
options['showast']['Full'] = True
|
options['showast']['after'] = True
|
||||||
|
options['showast']['before'] = True
|
||||||
options['do_verify'] = None
|
options['do_verify'] = None
|
||||||
elif opt in ('--grammar', '-g'):
|
elif opt in ('--grammar', '-g'):
|
||||||
options['showgrammar'] = True
|
options['showgrammar'] = True
|
||||||
|
@@ -111,6 +111,7 @@ def decompile(
|
|||||||
grammar = dict(PARSER_DEFAULT_DEBUG)
|
grammar = dict(PARSER_DEFAULT_DEBUG)
|
||||||
if showgrammar:
|
if showgrammar:
|
||||||
grammar["reduce"] = True
|
grammar["reduce"] = True
|
||||||
|
|
||||||
debug_opts = {"asm": asm, "tree": showast, "grammar": grammar}
|
debug_opts = {"asm": asm, "tree": showast, "grammar": grammar}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@@ -49,7 +49,7 @@ def maybe_show_tree(walker, ast):
|
|||||||
stream = sys.stdout
|
stream = sys.stdout
|
||||||
if (
|
if (
|
||||||
isinstance(walker.showast, dict)
|
isinstance(walker.showast, dict)
|
||||||
and walker.showast.get("Full", False)
|
and walker.showast.get("after", False)
|
||||||
and hasattr(walker, "str_with_template")
|
and hasattr(walker, "str_with_template")
|
||||||
):
|
):
|
||||||
walker.str_with_template(ast)
|
walker.str_with_template(ast)
|
||||||
|
Reference in New Issue
Block a user