You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
It is already too complex and will get worse in Python 3.6. Note: make_function in fragments.py is still inside and probably needs fixup.
12 lines
412 B
Python
12 lines
412 B
Python
import uncompyle6.parser as python_parser
|
|
class ParserError(python_parser.ParserError):
|
|
def __init__(self, error, tokens):
|
|
self.error = error # previous exception
|
|
self.tokens = tokens
|
|
|
|
def __str__(self):
|
|
lines = ['--- This code section failed: ---']
|
|
lines.extend([str(i) for i in self.tokens])
|
|
lines.extend( ['', str(self.error)] )
|
|
return '\n'.join(lines)
|