mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
bpo-32137: The repr of deeply nested dict now raises a RecursionError (#4570)
instead of crashing due to a stack overflow. This perhaps will fix similar problems in other extension types.
This commit is contained in:
parent
eea3cc1ef0
commit
1fb72d2ad2
7 changed files with 26 additions and 9 deletions
|
|
@ -364,10 +364,7 @@ list_repr(PyListObject *v)
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (Py_EnterRecursiveCall(" while getting the repr of a list"))
|
||||
goto error;
|
||||
s = PyObject_Repr(v->ob_item[i]);
|
||||
Py_LeaveRecursiveCall();
|
||||
if (s == NULL)
|
||||
goto error;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue