mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-36829: Add _PyErr_WriteUnraisableMsg() (GH-13488)
* sys.unraisablehook: add 'err_msg' field to UnraisableHookArgs. * Use _PyErr_WriteUnraisableMsg() in _ctypes _DictRemover_call() and gc delete_garbage().
This commit is contained in:
parent
2f0bfd27a5
commit
71c52e3048
9 changed files with 133 additions and 45 deletions
|
|
@ -929,9 +929,8 @@ delete_garbage(struct _gc_runtime_state *state,
|
|||
Py_INCREF(op);
|
||||
(void) clear(op);
|
||||
if (PyErr_Occurred()) {
|
||||
PySys_WriteStderr("Exception ignored in tp_clear of "
|
||||
"%.50s\n", Py_TYPE(op)->tp_name);
|
||||
PyErr_WriteUnraisable(NULL);
|
||||
_PyErr_WriteUnraisableMsg("in tp_clear of",
|
||||
(PyObject*)Py_TYPE(op));
|
||||
}
|
||||
Py_DECREF(op);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue