summaryrefslogtreecommitdiffstats
path: root/Lib/_pyrepl
diff options
context:
space:
mode:
authorƁukasz Langa <lukasz@langa.pl>2024-07-22 11:04:08 (GMT)
committerGitHub <noreply@github.com>2024-07-22 11:04:08 (GMT)
commitdc93d1125f594ac7aece98558eaf33d09c348519 (patch)
treedb2bc23e9e74df4a9ce22a872c2825418597f57b /Lib/_pyrepl
parentcad11a2bdceb6d4683ae5654ce555cdf5f191217 (diff)
downloadcpython-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.py2
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")