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 deparse_code_with_fragments_and_map and simplify
This commit is contained in:
@@ -1643,7 +1643,7 @@ class FragmentsWalker(pysource.SourceWalker, object):
|
||||
pass
|
||||
|
||||
def deparse_code(version, co, out=StringIO(), showasm=False, showast=False,
|
||||
showgrammar=False, is_pypy=False):
|
||||
showgrammar=False, is_pypy=False, walker=FragmentsWalker):
|
||||
"""
|
||||
Convert the code object co into a python source fragment.
|
||||
|
||||
@@ -1683,7 +1683,8 @@ def deparse_code(version, co, out=StringIO(), showasm=False, showast=False,
|
||||
|
||||
# Build AST from disassembly.
|
||||
# deparsed = pysource.FragmentsWalker(out, scanner, showast=showast)
|
||||
deparsed = FragmentsWalker(version, scanner, showast=showast, debug_parser=debug_parser)
|
||||
deparsed = walker(version, scanner, showast=showast,
|
||||
debug_parser=debug_parser)
|
||||
|
||||
deparsed.ast = deparsed.build_ast(tokens, customize)
|
||||
|
||||
|
Reference in New Issue
Block a user