Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Doc/c-api/init_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ Some options are read from the :mod:`sys` attributes. For example, the option
The caller must have an :term:`attached thread state`. The function cannot
be called before Python initialization nor after Python finalization.

.. audit-event:: cpython.PyConfig_Set name,value c.PyConfig_Set

.. versionadded:: 3.14


Expand Down
4 changes: 4 additions & 0 deletions Python/initconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -4527,6 +4527,10 @@ config_set_sys_flag(const PyConfigSpec *spec, int int_value)
int
PyConfig_Set(const char *name, PyObject *value)
{
if (PySys_Audit("cpython.PyConfig_Set", "sO", name, value) < 0) {
return -1;
}

const PyConfigSpec *spec = config_find_spec(name);
if (spec == NULL) {
spec = preconfig_find_spec(name);
Expand Down
Loading