mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
bltin_exc: Removed the leaf_exc flag in the structure, which was only
used to build the fallback string-based exception.
This commit is contained in:
parent
101de37907
commit
1226588e57
1 changed files with 29 additions and 35 deletions
|
@ -2397,45 +2397,39 @@ static struct
|
||||||
{
|
{
|
||||||
char* name;
|
char* name;
|
||||||
PyObject** exc;
|
PyObject** exc;
|
||||||
int leaf_exc;
|
|
||||||
}
|
}
|
||||||
bltin_exc[] = {
|
bltin_exc[] = {
|
||||||
{"Exception", &PyExc_Exception, 0},
|
{"Exception", &PyExc_Exception},
|
||||||
{"StandardError", &PyExc_StandardError, 0},
|
{"StandardError", &PyExc_StandardError},
|
||||||
{"ArithmeticError", &PyExc_ArithmeticError, 0},
|
{"ArithmeticError", &PyExc_ArithmeticError},
|
||||||
{"LookupError", &PyExc_LookupError, 0},
|
{"LookupError", &PyExc_LookupError},
|
||||||
{"AssertionError", &PyExc_AssertionError, 1},
|
{"AssertionError", &PyExc_AssertionError},
|
||||||
{"AttributeError", &PyExc_AttributeError, 1},
|
{"AttributeError", &PyExc_AttributeError},
|
||||||
{"EOFError", &PyExc_EOFError, 1},
|
{"EOFError", &PyExc_EOFError},
|
||||||
{"FloatingPointError", &PyExc_FloatingPointError, 1},
|
{"FloatingPointError", &PyExc_FloatingPointError},
|
||||||
{"EnvironmentError", &PyExc_EnvironmentError, 0},
|
{"EnvironmentError", &PyExc_EnvironmentError},
|
||||||
{"IOError", &PyExc_IOError, 1},
|
{"IOError", &PyExc_IOError},
|
||||||
{"OSError", &PyExc_OSError, 1},
|
{"OSError", &PyExc_OSError},
|
||||||
{"ImportError", &PyExc_ImportError, 1},
|
{"ImportError", &PyExc_ImportError},
|
||||||
{"IndexError", &PyExc_IndexError, 1},
|
{"IndexError", &PyExc_IndexError},
|
||||||
{"KeyError", &PyExc_KeyError, 1},
|
{"KeyError", &PyExc_KeyError},
|
||||||
{"KeyboardInterrupt", &PyExc_KeyboardInterrupt, 1},
|
{"KeyboardInterrupt", &PyExc_KeyboardInterrupt},
|
||||||
{"MemoryError", &PyExc_MemoryError, 1},
|
{"MemoryError", &PyExc_MemoryError},
|
||||||
/* Note: NameError is not a leaf in exceptions.py, but unlike
|
{"NameError", &PyExc_NameError},
|
||||||
the other non-leafs NameError is meant to be raised directly
|
{"OverflowError", &PyExc_OverflowError},
|
||||||
at times -- the leaf_exc member really seems to mean something
|
{"RuntimeError", &PyExc_RuntimeError},
|
||||||
like "this is an abstract base class" when false.
|
{"NotImplementedError",&PyExc_NotImplementedError},
|
||||||
*/
|
{"SyntaxError", &PyExc_SyntaxError},
|
||||||
{"NameError", &PyExc_NameError, 1},
|
{"SystemError", &PyExc_SystemError},
|
||||||
{"OverflowError", &PyExc_OverflowError, 1},
|
{"SystemExit", &PyExc_SystemExit},
|
||||||
{"RuntimeError", &PyExc_RuntimeError, 1},
|
{"UnboundLocalError", &PyExc_UnboundLocalError},
|
||||||
{"NotImplementedError",&PyExc_NotImplementedError,1},
|
{"UnicodeError", &PyExc_UnicodeError},
|
||||||
{"SyntaxError", &PyExc_SyntaxError, 1},
|
{"TypeError", &PyExc_TypeError},
|
||||||
{"SystemError", &PyExc_SystemError, 1},
|
{"ValueError", &PyExc_ValueError},
|
||||||
{"SystemExit", &PyExc_SystemExit, 1},
|
|
||||||
{"UnboundLocalError", &PyExc_UnboundLocalError, 1},
|
|
||||||
{"UnicodeError", &PyExc_UnicodeError, 1},
|
|
||||||
{"TypeError", &PyExc_TypeError, 1},
|
|
||||||
{"ValueError", &PyExc_ValueError, 1},
|
|
||||||
#ifdef MS_WINDOWS
|
#ifdef MS_WINDOWS
|
||||||
{"WindowsError", &PyExc_WindowsError, 1},
|
{"WindowsError", &PyExc_WindowsError},
|
||||||
#endif
|
#endif
|
||||||
{"ZeroDivisionError", &PyExc_ZeroDivisionError, 1},
|
{"ZeroDivisionError", &PyExc_ZeroDivisionError},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue