diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-07-03 05:04:23 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-07-03 05:04:23 (GMT) |
commit | f488fb422a641aa7c38eb63c09f459e4baff7bc4 (patch) | |
tree | f09d64f919af622c0ebf28adb9a3bfec567e47c8 /Include | |
parent | 27be130ec71fa95e2496bd9e42505aa6c7457682 (diff) | |
download | cpython-f488fb422a641aa7c38eb63c09f459e4baff7bc4.zip cpython-f488fb422a641aa7c38eb63c09f459e4baff7bc4.tar.gz cpython-f488fb422a641aa7c38eb63c09f459e4baff7bc4.tar.bz2 |
Issue #19235: Add new RecursionError exception. Patch by Georg Brandl.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/ceval.h | 6 | ||||
-rw-r--r-- | Include/pyerrors.h | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Include/ceval.h b/Include/ceval.h index 2472ae6..eb1ee43 100644 --- a/Include/ceval.h +++ b/Include/ceval.h @@ -48,16 +48,16 @@ PyAPI_FUNC(int) Py_MakePendingCalls(void); In Python 3.0, this protection has two levels: * normal anti-recursion protection is triggered when the recursion level - exceeds the current recursion limit. It raises a RuntimeError, and sets + exceeds the current recursion limit. It raises a RecursionError, and sets the "overflowed" flag in the thread state structure. This flag temporarily *disables* the normal protection; this allows cleanup code to potentially outgrow the recursion limit while processing the - RuntimeError. + RecursionError. * "last chance" anti-recursion protection is triggered when the recursion level exceeds "current recursion limit + 50". By construction, this protection can only be triggered when the "overflowed" flag is set. It means the cleanup code has itself gone into an infinite loop, or the - RuntimeError has been mistakingly ignored. When this protection is + RecursionError has been mistakingly ignored. When this protection is triggered, the interpreter aborts with a Fatal Error. In addition, the "overflowed" flag is automatically reset when the diff --git a/Include/pyerrors.h b/Include/pyerrors.h index a019865..35aedb7 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -167,6 +167,7 @@ PyAPI_DATA(PyObject *) PyExc_MemoryError; PyAPI_DATA(PyObject *) PyExc_NameError; PyAPI_DATA(PyObject *) PyExc_OverflowError; PyAPI_DATA(PyObject *) PyExc_RuntimeError; +PyAPI_DATA(PyObject *) PyExc_RecursionError; PyAPI_DATA(PyObject *) PyExc_NotImplementedError; PyAPI_DATA(PyObject *) PyExc_SyntaxError; PyAPI_DATA(PyObject *) PyExc_IndentationError; |