You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +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'):
|
||||
if 'showast' not in options:
|
||||
options['showast'] = {}
|
||||
options['showast']['Full'] = True
|
||||
options['showast']['after'] = True
|
||||
options['showast']['before'] = True
|
||||
options['do_verify'] = None
|
||||
elif opt in ('--grammar', '-g'):
|
||||
options['showgrammar'] = True
|
||||
|
@@ -111,6 +111,7 @@ def decompile(
|
||||
grammar = dict(PARSER_DEFAULT_DEBUG)
|
||||
if showgrammar:
|
||||
grammar["reduce"] = True
|
||||
|
||||
debug_opts = {"asm": asm, "tree": showast, "grammar": grammar}
|
||||
|
||||
try:
|
||||
|
@@ -49,7 +49,7 @@ def maybe_show_tree(walker, ast):
|
||||
stream = sys.stdout
|
||||
if (
|
||||
isinstance(walker.showast, dict)
|
||||
and walker.showast.get("Full", False)
|
||||
and walker.showast.get("after", False)
|
||||
and hasattr(walker, "str_with_template")
|
||||
):
|
||||
walker.str_with_template(ast)
|
||||
|
Reference in New Issue
Block a user