summaryrefslogtreecommitdiffstats
path: root/Lib/test/audit-tests.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2022-07-17 15:11:24 (GMT)
committerGitHub <noreply@github.com>2022-07-17 15:11:24 (GMT)
commit044a593cbbe1639e906e06c47504dd1020ddfee4 (patch)
treead204fabeee64b9015959c73398a9e41f51213eb /Lib/test/audit-tests.py
parent5c19ddab65f91d190ec94c494e95c5d551a45efc (diff)
downloadcpython-044a593cbbe1639e906e06c47504dd1020ddfee4.zip
cpython-044a593cbbe1639e906e06c47504dd1020ddfee4.tar.gz
cpython-044a593cbbe1639e906e06c47504dd1020ddfee4.tar.bz2
gh-91348: Restore frame argument to sys._getframe audit event (GH-94928)
Diffstat (limited to 'Lib/test/audit-tests.py')
-rw-r--r--Lib/test/audit-tests.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/audit-tests.py b/Lib/test/audit-tests.py
index ccec9fe..00333cc 100644
--- a/Lib/test/audit-tests.py
+++ b/Lib/test/audit-tests.py
@@ -408,6 +408,17 @@ def test_sqlite3():
raise RuntimeError("Expected sqlite3.load_extension to fail")
+def test_sys_getframe():
+ import sys
+
+ def hook(event, args):
+ if event.startswith("sys."):
+ print(event, args[0].f_code.co_name)
+
+ sys.addaudithook(hook)
+ sys._getframe()
+
+
if __name__ == "__main__":
from test.support import suppress_msvcrt_asserts