Files
python-uncompyle6/uncompyle6/semantics/parser_error.py
rocky 2328ca7a55 Break out make_function() into its own file.
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.
2016-10-29 07:22:58 -04:00

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)