summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-08-23 02:56:07 (GMT)
committerGuido van Rossum <guido@python.org>2001-08-23 02:56:07 (GMT)
commitae347b33befbbf9068473f373def1620f2bab805 (patch)
treef82182465c6a204ea254d08c0a5efd506a124449
parent7c198d3cde570e0429ae05bf101d61512e7346f2 (diff)
downloadcpython-ae347b33befbbf9068473f373def1620f2bab805.zip
cpython-ae347b33befbbf9068473f373def1620f2bab805.tar.gz
cpython-ae347b33befbbf9068473f373def1620f2bab805.tar.bz2
Introduce OverflowWarning -- to be issued when short int operations
are overflowing and a long int operation is substituted.
-rw-r--r--Include/pyerrors.h1
-rw-r--r--Python/exceptions.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index 1ee4fe2..d7b7639 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -66,6 +66,7 @@ extern DL_IMPORT(PyObject *) PyExc_Warning;
extern DL_IMPORT(PyObject *) PyExc_UserWarning;
extern DL_IMPORT(PyObject *) PyExc_DeprecationWarning;
extern DL_IMPORT(PyObject *) PyExc_SyntaxWarning;
+extern DL_IMPORT(PyObject *) PyExc_OverflowWarning;
extern DL_IMPORT(PyObject *) PyExc_RuntimeWarning;
diff --git a/Python/exceptions.c b/Python/exceptions.c
index 6fb52ca..ef9d01c 100644
--- a/Python/exceptions.c
+++ b/Python/exceptions.c
@@ -105,6 +105,7 @@ Exception\n\
+-- UserWarning\n\
+-- DeprecationWarning\n\
+-- SyntaxWarning\n\
+ +-- OverflowWarning\n\
+-- RuntimeWarning";
@@ -912,6 +913,9 @@ static char
SyntaxWarning__doc__[] = "Base class for warnings about dubious syntax.";
static char
+OverflowWarning__doc__[] = "Base class for warnings about numeric overflow.";
+
+static char
RuntimeWarning__doc__[] =
"Base class for warnings about dubious runtime behavior.";
@@ -973,6 +977,7 @@ PyObject *PyExc_Warning;
PyObject *PyExc_UserWarning;
PyObject *PyExc_DeprecationWarning;
PyObject *PyExc_SyntaxWarning;
+PyObject *PyExc_OverflowWarning;
PyObject *PyExc_RuntimeWarning;
@@ -1047,6 +1052,8 @@ static struct {
{"DeprecationWarning", &PyExc_DeprecationWarning, &PyExc_Warning,
DeprecationWarning__doc__},
{"SyntaxWarning", &PyExc_SyntaxWarning, &PyExc_Warning, SyntaxWarning__doc__},
+ {"OverflowWarning", &PyExc_OverflowWarning, &PyExc_Warning,
+ OverflowWarning__doc__},
{"RuntimeWarning", &PyExc_RuntimeWarning, &PyExc_Warning,
RuntimeWarning__doc__},
/* Sentinel */