Mercurial > cpython-lru_cache-weakref
diff Python/exceptions.c @ 13539:feab677269e0 legacy-trunk
Create two new exceptions: IndentationError and TabError. These are
used for indentation related errors. This patch includes Ping's
improvements for indentation-related error messages.
Closes SourceForge patches #100734 and #100856.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Tue, 11 Jul 2000 17:53:00 +0000 |
| parents | 67fd19d74528 |
| children | e558eb228a46 |
line wrap: on
line diff
--- a/Python/exceptions.c Tue Jul 11 17:40:30 2000 +0000 +++ b/Python/exceptions.c Tue Jul 11 17:53:00 2000 +0000 @@ -68,6 +68,11 @@ |\n\ +-- AttributeError\n\ +-- SyntaxError\n\ + | |\n\ + | +-- IndentationError\n\ + | |\n\ + | +-- TabError\n\ + |\n\ +-- TypeError\n\ +-- AssertionError\n\ +-- LookupError\n\ @@ -783,6 +788,12 @@ static char MemoryError__doc__[] = "Out of memory."; +static char +IndentationError__doc__[] = "Improper indentation."; + +static char +TabError__doc__[] = "Improper mixture of spaces and tabs."; + /* module global functions */ @@ -817,6 +828,8 @@ PyObject *PyExc_RuntimeError; PyObject *PyExc_NotImplementedError; PyObject *PyExc_SyntaxError; +PyObject *PyExc_IndentationError; +PyObject *PyExc_TabError; PyObject *PyExc_SystemError; PyObject *PyExc_SystemExit; PyObject *PyExc_UnboundLocalError; @@ -878,6 +891,10 @@ {"AttributeError", &PyExc_AttributeError, 0, AttributeError__doc__}, {"SyntaxError", &PyExc_SyntaxError, 0, SyntaxError__doc__, SyntaxError_methods, SyntaxError__classinit__}, + {"IndentationError", &PyExc_IndentationError, &PyExc_SyntaxError, + IndentationError__doc__}, + {"TabError", &PyExc_TabError, &PyExc_IndentationError, + TabError__doc__}, {"AssertionError", &PyExc_AssertionError, 0, AssertionError__doc__}, {"LookupError", &PyExc_LookupError, 0, LookupError__doc__}, {"IndexError", &PyExc_IndexError, &PyExc_LookupError,
