diff options
author | Steve Dower <steve.dower@microsoft.com> | 2019-05-23 15:45:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-23 15:45:22 (GMT) |
commit | b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184 (patch) | |
tree | 5370a2a075707cb0b37ce135cad6ffe23da424c4 /Python/clinic | |
parent | e788057a9188ff37e232729815dfda2529079420 (diff) | |
download | cpython-b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184.zip cpython-b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184.tar.gz cpython-b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184.tar.bz2 |
bpo-36842: Implement PEP 578 (GH-12613)
Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
Diffstat (limited to 'Python/clinic')
-rw-r--r-- | Python/clinic/sysmodule.c.h | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/Python/clinic/sysmodule.c.h b/Python/clinic/sysmodule.c.h index aede60a..2a4ec72 100644 --- a/Python/clinic/sysmodule.c.h +++ b/Python/clinic/sysmodule.c.h @@ -2,6 +2,38 @@ preserve [clinic start generated code]*/ +PyDoc_STRVAR(sys_addaudithook__doc__, +"addaudithook($module, /, hook)\n" +"--\n" +"\n" +"Adds a new audit hook callback."); + +#define SYS_ADDAUDITHOOK_METHODDEF \ + {"addaudithook", (PyCFunction)(void(*)(void))sys_addaudithook, METH_FASTCALL|METH_KEYWORDS, sys_addaudithook__doc__}, + +static PyObject * +sys_addaudithook_impl(PyObject *module, PyObject *hook); + +static PyObject * +sys_addaudithook(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + static const char * const _keywords[] = {"hook", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "addaudithook", 0}; + PyObject *argsbuf[1]; + PyObject *hook; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); + if (!args) { + goto exit; + } + hook = args[0]; + return_value = sys_addaudithook_impl(module, hook); + +exit: + return return_value; +} + PyDoc_STRVAR(sys_displayhook__doc__, "displayhook($module, object, /)\n" "--\n" @@ -1076,4 +1108,4 @@ sys_getandroidapilevel(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef SYS_GETANDROIDAPILEVEL_METHODDEF #define SYS_GETANDROIDAPILEVEL_METHODDEF #endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */ -/*[clinic end generated code: output=603e4d5a453dc769 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3c32bc91ec659509 input=a9049054013a1b77]*/ |