diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-05-27 08:57:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-27 08:57:14 +0200 |
commit | 71c52e3048dd07567f0c690eab4e5d57be66f534 (patch) | |
tree | 7f3a063d2d3edb324d7d00bf13a66ddad689d22e /Modules/gcmodule.c | |
parent | 2f0bfd27a5e3a9a7cbeb2ddd45ce50c3d4bdb4e9 (diff) | |
download | cpython-71c52e3048dd07567f0c690eab4e5d57be66f534.tar.gz cpython-71c52e3048dd07567f0c690eab4e5d57be66f534.zip |
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().
Diffstat (limited to 'Modules/gcmodule.c')
-rw-r--r-- | Modules/gcmodule.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index be9b73a8446..3b15c7ba5b6 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -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); } |