diff options
author | Ćukasz Langa <lukasz@langa.pl> | 2024-07-22 11:04:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-22 11:04:08 (GMT) |
commit | dc93d1125f594ac7aece98558eaf33d09c348519 (patch) | |
tree | db2bc23e9e74df4a9ce22a872c2825418597f57b /Lib/_pyrepl | |
parent | cad11a2bdceb6d4683ae5654ce555cdf5f191217 (diff) | |
download | cpython-dc93d1125f594ac7aece98558eaf33d09c348519.zip cpython-dc93d1125f594ac7aece98558eaf33d09c348519.tar.gz cpython-dc93d1125f594ac7aece98558eaf33d09c348519.tar.bz2 |
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.
Diffstat (limited to 'Lib/_pyrepl')
-rw-r--r-- | Lib/_pyrepl/main.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/_pyrepl/main.py b/Lib/_pyrepl/main.py index 8d6e07d..a6f824d 100644 --- a/Lib/_pyrepl/main.py +++ b/Lib/_pyrepl/main.py @@ -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") |