summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2019-11-28 16:46:11 (GMT)
committerGitHub <noreply@github.com>2019-11-28 16:46:11 (GMT)
commitbea33f5e1db6e4a554919a82894f44568576e979 (patch)
tree37789378933d7091eb0012d6ad3277aa8685a979 /Python/sysmodule.c
parent02519f75d15b063914a11351da30178ca4ceb54b (diff)
downloadcpython-bea33f5e1db6e4a554919a82894f44568576e979.zip
cpython-bea33f5e1db6e4a554919a82894f44568576e979.tar.gz
cpython-bea33f5e1db6e4a554919a82894f44568576e979.tar.bz2
bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisable hooks are invoked (GH-17392)
Also fixes some potential segfaults in unraisable hook handling.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 30c7e98..78b9d22 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -323,8 +323,8 @@ PySys_AddAuditHook(Py_AuditHookFunction hook, void *userData)
/* Cannot invoke hooks until we are initialized */
if (runtime->initialized) {
if (PySys_Audit("sys.addaudithook", NULL) < 0) {
- if (_PyErr_ExceptionMatches(tstate, PyExc_Exception)) {
- /* We do not report errors derived from Exception */
+ if (_PyErr_ExceptionMatches(tstate, PyExc_RuntimeError)) {
+ /* We do not report errors derived from RuntimeError */
_PyErr_Clear(tstate);
return 0;
}