mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-121957: Emit audit events for python -i
and python -m asyncio
(GH-121958)
Relatedly, emit the `cpython.run_startup` event from the Python version of `PYTHONSTARTUP` handling.
This commit is contained in:
parent
cad11a2bdc
commit
dc93d1125f
6 changed files with 36 additions and 2 deletions
|
@ -39,6 +39,8 @@ def interactive_console(mainmodule=None, quiet=False, pythonstartup=False):
|
|||
# sys._baserepl() above does this internally, we do it here
|
||||
startup_path = os.getenv("PYTHONSTARTUP")
|
||||
if pythonstartup and startup_path:
|
||||
sys.audit("cpython.run_startup", startup_path)
|
||||
|
||||
import tokenize
|
||||
with tokenize.open(startup_path) as f:
|
||||
startup_code = compile(f.read(), startup_path, "exec")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue