mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
Issue #20440: More use of Py_SETREF.
This patch is manually crafted and contains changes that couldn't be handled automatically.
This commit is contained in:
parent
4a1e70fc31
commit
191321d11b
7 changed files with 39 additions and 58 deletions
|
@ -315,14 +315,11 @@ finally:
|
|||
tstate = PyThreadState_GET();
|
||||
if (++tstate->recursion_depth > Py_GetRecursionLimit()) {
|
||||
--tstate->recursion_depth;
|
||||
/* throw away the old exception... */
|
||||
Py_DECREF(*exc);
|
||||
Py_DECREF(*val);
|
||||
/* ... and use the recursion error instead */
|
||||
*exc = PyExc_RecursionError;
|
||||
*val = PyExc_RecursionErrorInst;
|
||||
Py_INCREF(*exc);
|
||||
Py_INCREF(*val);
|
||||
/* throw away the old exception and use the recursion error instead */
|
||||
Py_INCREF(PyExc_RecursionError);
|
||||
Py_SETREF(*exc, PyExc_RecursionError);
|
||||
Py_INCREF(PyExc_RecursionErrorInst);
|
||||
Py_SETREF(*val, PyExc_RecursionErrorInst);
|
||||
/* just keeping the old traceback */
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue