File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -1611,19 +1611,18 @@ static void
1611
1611
slot_tp_del (PyObject * self )
1612
1612
{
1613
1613
PyObject * del , * res ;
1614
- PyObject * error_type , * error_value , * error_traceback ;
1615
1614
1616
1615
/* Temporarily resurrect the object. */
1617
1616
assert (Py_REFCNT (self ) == 0 );
1618
1617
Py_SET_REFCNT (self , 1 );
1619
1618
1620
1619
/* Save the current exception, if any. */
1621
- PyErr_Fetch ( & error_type , & error_value , & error_traceback );
1620
+ PyObject * exc = PyErr_GetRaisedException ( );
1622
1621
1623
1622
PyObject * tp_del = PyUnicode_InternFromString ("__tp_del__" );
1624
1623
if (tp_del == NULL ) {
1625
1624
PyErr_WriteUnraisable (NULL );
1626
- PyErr_Restore ( error_type , error_value , error_traceback );
1625
+ PyErr_SetRaisedException ( exc );
1627
1626
return ;
1628
1627
}
1629
1628
/* Execute __del__ method, if any. */
@@ -1638,7 +1637,7 @@ slot_tp_del(PyObject *self)
1638
1637
}
1639
1638
1640
1639
/* Restore the saved exception. */
1641
- PyErr_Restore ( error_type , error_value , error_traceback );
1640
+ PyErr_SetRaisedException ( exc );
1642
1641
1643
1642
/* Undo the temporary resurrection; can't use DECREF here, it would
1644
1643
* cause a recursive call.
You can’t perform that action at this time.
0 commit comments