bpo-38644: Use _PySys_Audit(): pass tstate explicitly (GH-19183)

Add the dependency to tstate more explicit.
This commit is contained in:
Victor Stinner 2020-03-27 15:11:45 +01:00 committed by GitHub
parent 33f15a16d4
commit 1c1e68cf3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 25 deletions

View file

@ -5,6 +5,7 @@
#include "pycore_initconfig.h"
#include "pycore_pyerrors.h"
#include "pycore_pystate.h"
#include "pycore_sysmodule.h"
#include "pycore_traceback.h"
#ifndef __STDC__
@ -1410,7 +1411,7 @@ _PyErr_WriteUnraisableMsg(const char *err_msg_str, PyObject *obj)
goto default_hook;
}
if (PySys_Audit("sys.unraisablehook", "OO", hook, hook_args) < 0) {
if (_PySys_Audit(tstate, "sys.unraisablehook", "OO", hook, hook_args) < 0) {
Py_DECREF(hook_args);
err_msg_str = "Exception ignored in audit hook";
obj = NULL;