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:
Victor Stinner 2019-05-27 08:57:14 +02:00 committed by GitHub
parent 2f0bfd27a5
commit 71c52e3048
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 133 additions and 45 deletions

View file

@ -689,14 +689,15 @@ Handle an unraisable exception.
The unraisable argument has the following attributes:
* exc_type: Exception type.
* exc_value: Exception value.
* exc_tb: Exception traceback, can be None.
* obj: Object causing the exception, can be None.
* exc_value: Exception value, can be None.
* exc_traceback: Exception traceback, can be None.
* err_msg: Error message, can be None.
* object: Object causing the exception, can be None.
[clinic start generated code]*/
static PyObject *
sys_unraisablehook(PyObject *module, PyObject *unraisable)
/*[clinic end generated code: output=bb92838b32abaa14 input=fdbdb47fdd0bee06]*/
/*[clinic end generated code: output=bb92838b32abaa14 input=ec3af148294af8d3]*/
{
return _PyErr_WriteUnraisableDefaultHook(unraisable);
}