You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
Add flag to tolerate deparse errors...
and keep going. The fragment parser should ignore errors in nested function definitions
This commit is contained in:
@@ -166,7 +166,7 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
def __init__(self, version, out, scanner, showast=False,
|
||||
debug_parser=PARSER_DEFAULT_DEBUG,
|
||||
compile_mode='exec', is_pypy=False,
|
||||
linestarts={}):
|
||||
linestarts={}, tolerate_errors=False):
|
||||
"""version is the Python version (a float) of the Python dialect
|
||||
|
||||
of both the AST and language we should produce.
|
||||
@@ -214,6 +214,10 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
self.line_number = 0
|
||||
self.ast_errors = []
|
||||
|
||||
# Sometimes we may want to continue decompiling when there are errors
|
||||
# and sometimes not
|
||||
self.tolerate_errors = tolerate_errors
|
||||
|
||||
# hide_internal suppresses displaying the additional instructions that sometimes
|
||||
# exist in code but but were not written in the source code.
|
||||
# An example is:
|
||||
|
Reference in New Issue
Block a user