From b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Thu, 23 May 2019 08:45:22 -0700 Subject: bpo-36842: Implement PEP 578 (GH-12613) Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs. --- Python/pythonrun.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index d2b27615903..7219f548fd2 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; -- cgit v1.2.3