summaryrefslogtreecommitdiff
path: root/Python/exceptions.c
diff options
context:
space:
mode:
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 ad8021e0db..214d8e5e62 100644
--- a/Python/exceptions.c
+++ b/Python/exceptions.c
@@ -52,6 +52,7 @@ recommended that user defined class based exceptions be derived from the\n\
Exception\n\
|\n\
+-- SystemExit\n\
+ +-- StopIteration\n\
+-- StandardError\n\
| |\n\
| +-- KeyboardInterrupt\n\
@@ -369,6 +370,9 @@ StandardError__doc__[] = "Base class for all standard Python exceptions.";
static char
TypeError__doc__[] = "Inappropriate argument type.";
+static char
+StopIteration__doc__[] = "Signal the end from iterator.next().";
+
static char
@@ -924,6 +928,7 @@ static PyMethodDef functions[] = {
/* Global C API defined exceptions */
PyObject *PyExc_Exception;
+PyObject *PyExc_StopIteration;
PyObject *PyExc_StandardError;
PyObject *PyExc_ArithmeticError;
PyObject *PyExc_LookupError;
@@ -985,6 +990,8 @@ static struct {
* The first three classes MUST appear in exactly this order
*/
{"Exception", &PyExc_Exception},
+ {"StopIteration", &PyExc_StopIteration, &PyExc_Exception,
+ StopIteration__doc__},
{"StandardError", &PyExc_StandardError, &PyExc_Exception,
StandardError__doc__},
{"TypeError", &PyExc_TypeError, 0, TypeError__doc__},