summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2020-03-26 12:11:13 (GMT)
committerGitHub <noreply@github.com>2020-03-26 12:11:13 (GMT)
commit79ceccd1ec6ef7e487da2916f32c6f0d1477bd3d (patch)
tree0828189e62366dea1260db799cc27928fc42aee2 /Python/ceval.c
parent62d21c9d900664b2ca30c2d7edd80b6628abdf62 (diff)
downloadcpython-79ceccd1ec6ef7e487da2916f32c6f0d1477bd3d.zip
cpython-79ceccd1ec6ef7e487da2916f32c6f0d1477bd3d.tar.gz
cpython-79ceccd1ec6ef7e487da2916f32c6f0d1477bd3d.tar.bz2
bpo-38410: Properly handle PySys_Audit() failures (GH-16657)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 836457d..afaa6ff 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4785,17 +4785,18 @@ _PyEval_GetCoroutineOriginTrackingDepth(void)
return tstate->coroutine_origin_tracking_depth;
}
-void
+int
_PyEval_SetAsyncGenFirstiter(PyObject *firstiter)
{
PyThreadState *tstate = _PyThreadState_GET();
if (PySys_Audit("sys.set_asyncgen_hook_firstiter", NULL) < 0) {
- return;
+ return -1;
}
Py_XINCREF(firstiter);
Py_XSETREF(tstate->async_gen_firstiter, firstiter);
+ return 0;
}
PyObject *
@@ -4805,17 +4806,18 @@ _PyEval_GetAsyncGenFirstiter(void)
return tstate->async_gen_firstiter;
}
-void
+int
_PyEval_SetAsyncGenFinalizer(PyObject *finalizer)
{
PyThreadState *tstate = _PyThreadState_GET();
if (PySys_Audit("sys.set_asyncgen_hook_finalizer", NULL) < 0) {
- return;
+ return -1;
}
Py_XINCREF(finalizer);
Py_XSETREF(tstate->async_gen_finalizer, finalizer);
+ return 0;
}
PyObject *