mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-118331: Handle errors in _PyObject_SetManagedDict (#118334)
When detaching a dict, the `copy_values` call may fail due to out-of-memory errors. This can be triggered by test_no_memory in test_repl.
This commit is contained in:
parent
ee3413c1c7
commit
79688b5b0e
3 changed files with 20 additions and 13 deletions
|
|
@ -3167,7 +3167,7 @@ subtype_setdict(PyObject *obj, PyObject *value, void *context)
|
|||
}
|
||||
|
||||
if (Py_TYPE(obj)->tp_flags & Py_TPFLAGS_MANAGED_DICT) {
|
||||
_PyObject_SetManagedDict(obj, value);
|
||||
return _PyObject_SetManagedDict(obj, value);
|
||||
}
|
||||
else {
|
||||
dictptr = _PyObject_ComputedDictPointer(obj);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue