summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index c9afa8f8ba..a7da143077 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -695,6 +695,14 @@ _PyErr_PrintEx(PyThreadState *tstate, int set_sys_last_vars)
}
}
hook = _PySys_GetObjectId(&PyId_excepthook);
+ if (PySys_Audit("sys.excepthook", "OOOO", hook ? hook : Py_None,
+ exception, v, tb) < 0) {
+ if (PyErr_ExceptionMatches(PyExc_RuntimeError)) {
+ PyErr_Clear();
+ goto done;
+ }
+ _PyErr_WriteUnraisableMsg("in audit hook", NULL);
+ }
if (hook) {
PyObject* stack[3];
PyObject *result;