You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Python3 try/except handling improvements. Add Walker exception and use
that: fixes erroneous uncompyle success message on parse error.
This commit is contained in:
@@ -27,8 +27,10 @@ def uncompyle(version, co, out=None, showasm=False, showast=False,
|
||||
|
||||
try:
|
||||
pysource.deparse_code(version, co, out, showasm, showast, showgrammar)
|
||||
except pysource.ParserError as e : # parser failed, dump disassembly
|
||||
print(e, file=real_out)
|
||||
except pysource.WalkerError as e:
|
||||
# deparsing failed
|
||||
if real_out != out:
|
||||
print(e, file=real_out)
|
||||
raise
|
||||
|
||||
def uncompyle_file(filename, outstream=None, showasm=False, showast=False,
|
||||
|
Reference in New Issue
Block a user