Skip to content

Commit

Permalink
Don't chain exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mpage committed Apr 29, 2024
1 parent 7ba419d commit 15c85d4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Objects/weakrefobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1017,12 +1017,8 @@ PyObject_ClearWeakRefs(PyObject *object)
PyObject *tuple = PyTuple_New(num_weakrefs * 2);
if (tuple == NULL) {
_PyWeakref_ClearWeakRefsExceptCallbacks(object);
if (exc == NULL) {
PyErr_WriteUnraisable(NULL);
}
else {
_PyErr_ChainExceptions1(exc);
}
PyErr_WriteUnraisable(NULL);
PyErr_SetRaisedException(exc);
return;
}

Expand Down

0 comments on commit 15c85d4

Please sign in to comment.