diff options
author | Phillip J. Eby <pje@telecommunity.com> | 2005-08-02 00:46:46 +0000 |
---|---|---|
committer | Phillip J. Eby <pje@telecommunity.com> | 2005-08-02 00:46:46 +0000 |
commit | 0d6615fd29063bdaccb13e1fbae542fb666d8728 (patch) | |
tree | 0f18d41e2cb8831c9d244ab6586f9f8377592c67 /Python/exceptions.c | |
parent | d794666048510deca0d4987a4c74d0fca85be411 (diff) | |
download | cpython-0d6615fd29063bdaccb13e1fbae542fb666d8728.tar.gz cpython-0d6615fd29063bdaccb13e1fbae542fb666d8728.zip |
PEP 342 implementation. Per Guido's comments, the generator throw()
method still needs to support string exceptions, and allow None for the
third argument. Documentation updates are needed, too.
Diffstat (limited to 'Python/exceptions.c')
-rw-r--r-- | Python/exceptions.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/exceptions.c b/Python/exceptions.c index 2fd74bc76d3..2e7c820bf1e 100644 --- a/Python/exceptions.c +++ b/Python/exceptions.c @@ -57,6 +57,7 @@ Exception\n\ |\n\ +-- SystemExit\n\ +-- StopIteration\n\ + +-- GeneratorExit\n\ +-- StandardError\n\ | |\n\ | +-- KeyboardInterrupt\n\ @@ -394,6 +395,7 @@ PyDoc_STRVAR(StandardError__doc__, PyDoc_STRVAR(TypeError__doc__, "Inappropriate argument type."); PyDoc_STRVAR(StopIteration__doc__, "Signal the end from iterator.next()."); +PyDoc_STRVAR(GeneratorExit__doc__, "Request that a generator exit."); @@ -1583,6 +1585,7 @@ static PyMethodDef functions[] = { PyObject *PyExc_Exception; PyObject *PyExc_StopIteration; +PyObject *PyExc_GeneratorExit; PyObject *PyExc_StandardError; PyObject *PyExc_ArithmeticError; PyObject *PyExc_LookupError; @@ -1657,6 +1660,8 @@ static struct { {"Exception", &PyExc_Exception}, {"StopIteration", &PyExc_StopIteration, &PyExc_Exception, StopIteration__doc__}, + {"GeneratorExit", &PyExc_GeneratorExit, &PyExc_Exception, + GeneratorExit__doc__}, {"StandardError", &PyExc_StandardError, &PyExc_Exception, StandardError__doc__}, {"TypeError", &PyExc_TypeError, 0, TypeError__doc__}, |