summaryrefslogtreecommitdiff
path: root/Python/exceptions.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-08-23 02:56:07 +0000
committerGuido van Rossum <guido@python.org>2001-08-23 02:56:07 +0000
commitee7dadb5bf09955d57c792137512503e4fb6c325 (patch)
tree835c26d05473478c12bf1b08a51d67e0531dfcc3 /Python/exceptions.c
parent5290f7e543fa3f5810f3138f42cf737ba408c976 (diff)
downloadcpython-ee7dadb5bf09955d57c792137512503e4fb6c325.tar.gz
Introduce OverflowWarning -- to be issued when short int operations
are overflowing and a long int operation is substituted.
Diffstat (limited to 'Python/exceptions.c')
-rw-r--r--Python/exceptions.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/exceptions.c b/Python/exceptions.c
index 6fb52ca6c0..ef9d01c0a5 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 */