diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-07-03 01:04:23 -0400 |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-07-03 01:04:23 -0400 |
commit | 1f0eea05f78b032be72ee5b5787421acef61588d (patch) | |
tree | df649dbdcb14e9a2afce0d6e4629439dd72e1421 /Include | |
parent | 4c0dd9f7ff8d58c2da9cccd1ca1ad7ee96e29ce1 (diff) | |
download | cpython-1f0eea05f78b032be72ee5b5787421acef61588d.tar.gz |
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 2472ae6492..eb1ee43497 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 a0198659a1..35aedb7349 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; |