MCPcopy Create free account
hub / github.com/EasyIME/PIME / ParseError

Class ParseError

python/python3/tornado/template.py:700–720  ·  view source on GitHub ↗

Raised for template syntax errors. ``ParseError`` instances have ``filename`` and ``lineno`` attributes indicating the position of the error. .. versionchanged:: 4.3 Added ``filename`` and ``lineno`` attributes.

Source from the content-addressed store, hash-verified

698
699
700class ParseError(Exception):
701 """Raised for template syntax errors.
702
703 ``ParseError`` instances have ``filename`` and ``lineno`` attributes
704 indicating the position of the error.
705
706 .. versionchanged:: 4.3
707 Added ``filename`` and ``lineno`` attributes.
708 """
709
710 def __init__(
711 self, message: str, filename: Optional[str] = None, lineno: int = 0
712 ) -> None:
713 self.message = message
714 # The names "filename" and "lineno" are chosen for consistency
715 # with python SyntaxError.
716 self.filename = filename
717 self.lineno = lineno
718
719 def __str__(self) -> str:
720 return "%s at %s:%d" % (self.message, self.filename, self.lineno)
721
722
723class _CodeWriter(object):

Callers 3

_get_ancestorsMethod · 0.85
raise_parse_errorMethod · 0.85

Calls

no outgoing calls

Tested by 1