summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index d2b2761..7219f54 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1091,6 +1091,12 @@ run_mod(mod_ty mod, PyObject *filename, PyObject *globals, PyObject *locals,
co = PyAST_CompileObject(mod, filename, flags, -1, arena);
if (co == NULL)
return NULL;
+
+ if (PySys_Audit("exec", "O", co) < 0) {
+ Py_DECREF(co);
+ return NULL;
+ }
+
v = run_eval_code_obj(co, globals, locals);
Py_DECREF(co);
return v;