Introduce OverflowWarning -- to be issued when short int operations

are overflowing and a long int operation is substituted.
This commit is contained in:
Guido van Rossum 2001-08-23 02:56:07 +00:00
parent 7c198d3cde
commit ae347b33be
2 changed files with 8 additions and 0 deletions

View File

@ -66,6 +66,7 @@ extern DL_IMPORT(PyObject *) PyExc_Warning;
extern DL_IMPORT(PyObject *) PyExc_UserWarning; extern DL_IMPORT(PyObject *) PyExc_UserWarning;
extern DL_IMPORT(PyObject *) PyExc_DeprecationWarning; extern DL_IMPORT(PyObject *) PyExc_DeprecationWarning;
extern DL_IMPORT(PyObject *) PyExc_SyntaxWarning; extern DL_IMPORT(PyObject *) PyExc_SyntaxWarning;
extern DL_IMPORT(PyObject *) PyExc_OverflowWarning;
extern DL_IMPORT(PyObject *) PyExc_RuntimeWarning; extern DL_IMPORT(PyObject *) PyExc_RuntimeWarning;

View File

@ -105,6 +105,7 @@ Exception\n\
+-- UserWarning\n\ +-- UserWarning\n\
+-- DeprecationWarning\n\ +-- DeprecationWarning\n\
+-- SyntaxWarning\n\ +-- SyntaxWarning\n\
+-- OverflowWarning\n\
+-- RuntimeWarning"; +-- RuntimeWarning";
@ -911,6 +912,9 @@ DeprecationWarning__doc__[] =
static char static char
SyntaxWarning__doc__[] = "Base class for warnings about dubious syntax."; SyntaxWarning__doc__[] = "Base class for warnings about dubious syntax.";
static char
OverflowWarning__doc__[] = "Base class for warnings about numeric overflow.";
static char static char
RuntimeWarning__doc__[] = RuntimeWarning__doc__[] =
"Base class for warnings about dubious runtime behavior."; "Base class for warnings about dubious runtime behavior.";
@ -973,6 +977,7 @@ PyObject *PyExc_Warning;
PyObject *PyExc_UserWarning; PyObject *PyExc_UserWarning;
PyObject *PyExc_DeprecationWarning; PyObject *PyExc_DeprecationWarning;
PyObject *PyExc_SyntaxWarning; PyObject *PyExc_SyntaxWarning;
PyObject *PyExc_OverflowWarning;
PyObject *PyExc_RuntimeWarning; PyObject *PyExc_RuntimeWarning;
@ -1047,6 +1052,8 @@ static struct {
{"DeprecationWarning", &PyExc_DeprecationWarning, &PyExc_Warning, {"DeprecationWarning", &PyExc_DeprecationWarning, &PyExc_Warning,
DeprecationWarning__doc__}, DeprecationWarning__doc__},
{"SyntaxWarning", &PyExc_SyntaxWarning, &PyExc_Warning, SyntaxWarning__doc__}, {"SyntaxWarning", &PyExc_SyntaxWarning, &PyExc_Warning, SyntaxWarning__doc__},
{"OverflowWarning", &PyExc_OverflowWarning, &PyExc_Warning,
OverflowWarning__doc__},
{"RuntimeWarning", &PyExc_RuntimeWarning, &PyExc_Warning, {"RuntimeWarning", &PyExc_RuntimeWarning, &PyExc_Warning,
RuntimeWarning__doc__}, RuntimeWarning__doc__},
/* Sentinel */ /* Sentinel */