mirror of
https://github.com/python/cpython.git
synced 2025-08-23 02:04:56 +00:00
bpo-38922: Raise code.__new__ audit event when code object replace() is called (GH-17394)
This commit is contained in:
parent
0b41a922f9
commit
c7c01ab1e5
2 changed files with 9 additions and 0 deletions
|
@ -641,6 +641,13 @@ code_replace_impl(PyCodeObject *self, int co_argcount,
|
|||
|
||||
#undef CHECK_INT_ARG
|
||||
|
||||
if (PySys_Audit("code.__new__", "OOOiiiiii",
|
||||
co_code, co_filename, co_name, co_argcount,
|
||||
co_posonlyargcount, co_kwonlyargcount, co_nlocals,
|
||||
co_stacksize, co_flags) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (PyObject *)PyCode_NewWithPosOnlyArgs(
|
||||
co_argcount, co_posonlyargcount, co_kwonlyargcount, co_nlocals,
|
||||
co_stacksize, co_flags, (PyObject*)co_code, co_consts, co_names,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue