def pformat_exc(self, exc):
lines = []<EOL>try:<EOL><INDENT>pre_nl = self.last_query.rindex("<STR_LIT:\n>", <NUM_LIT:0>, exc.loc) + <NUM_LIT:1><EOL><DEDENT>except ValueError:<EOL><INDENT>pre_nl = <NUM_LIT:0><EOL><DEDENT>try:<EOL><INDENT>post_nl = self.last_query.index("<STR_LIT:\n>", exc.loc)<EOL><DEDENT>except ValueError:<EOL><INDENT>post_nl = len(self.last_query)<EOL><DEDENT>lines.append(self.last_query[:post_nl])<EOL>lines.append("<STR_LIT:U+0020>" * (exc.loc - pre_nl) + "<STR_LIT>")<EOL>lines.append(str(exc))<EOL>return "<STR_LIT:\n>".join(lines)<EOL>
Format an exception message for the last query's parse error