diff options
author | Zackery Spytz <zspytz@gmail.com> | 2020-03-26 12:11:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-26 12:11:13 (GMT) |
commit | 79ceccd1ec6ef7e487da2916f32c6f0d1477bd3d (patch) | |
tree | 0828189e62366dea1260db799cc27928fc42aee2 /Python/sysmodule.c | |
parent | 62d21c9d900664b2ca30c2d7edd80b6628abdf62 (diff) | |
download | cpython-79ceccd1ec6ef7e487da2916f32c6f0d1477bd3d.zip cpython-79ceccd1ec6ef7e487da2916f32c6f0d1477bd3d.tar.gz cpython-79ceccd1ec6ef7e487da2916f32c6f0d1477bd3d.tar.bz2 |
bpo-38410: Properly handle PySys_Audit() failures (GH-16657)
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index c78a627..c877fd7 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1222,10 +1222,12 @@ sys_set_asyncgen_hooks(PyObject *self, PyObject *args, PyObject *kw) Py_TYPE(finalizer)->tp_name); return NULL; } - _PyEval_SetAsyncGenFinalizer(finalizer); + if (_PyEval_SetAsyncGenFinalizer(finalizer) < 0) { + return NULL; + } } - else if (finalizer == Py_None) { - _PyEval_SetAsyncGenFinalizer(NULL); + else if (finalizer == Py_None && _PyEval_SetAsyncGenFinalizer(NULL) < 0) { + return NULL; } if (firstiter && firstiter != Py_None) { @@ -1235,10 +1237,12 @@ sys_set_asyncgen_hooks(PyObject *self, PyObject *args, PyObject *kw) Py_TYPE(firstiter)->tp_name); return NULL; } - _PyEval_SetAsyncGenFirstiter(firstiter); + if (_PyEval_SetAsyncGenFirstiter(firstiter) < 0) { + return NULL; + } } - else if (firstiter == Py_None) { - _PyEval_SetAsyncGenFirstiter(NULL); + else if (firstiter == Py_None && _PyEval_SetAsyncGenFirstiter(NULL) < 0) { + return NULL; } Py_RETURN_NONE; |