mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-91348: Restore frame argument to sys._getframe audit event (GH-94928)
This commit is contained in:
parent
5c19ddab65
commit
044a593cbb
4 changed files with 31 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue