* :c:func:`PyObject_SetArenaAllocator`
* :c:func:`Py_SetProgramName`
* :c:func:`Py_SetPythonHome`
- * :c:func:`PySys_ResetWarnOptions`
* the configuration functions covered in :ref:`init-config`
* Informative functions:
case *name* is deleted from the sys module. Returns ``0`` on success, ``-1``
on error.
-.. c:function:: void PySys_ResetWarnOptions()
-
- Reset :data:`sys.warnoptions` to an empty list. This function may be
- called prior to :c:func:`Py_Initialize`.
-
- .. deprecated-removed:: 3.13 3.15
- Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
-
.. c:function:: void PySys_WriteStdout(const char *format, ...)
Write the output string described by *format* to :data:`sys.stdout`. No
func,PySys_GetOptionalAttr,3.15,,
func,PySys_GetOptionalAttrString,3.15,,
func,PySys_GetXOptions,3.7,,
-func,PySys_ResetWarnOptions,3.2,,
func,PySys_SetArgv,3.2,,
func,PySys_SetArgvEx,3.2,,
func,PySys_SetObject,3.2,,
Set :c:member:`PyConfig.program_name` instead.
* :c:func:`!Py_SetPythonHome()`:
Set :c:member:`PyConfig.home` instead.
- * :c:func:`PySys_ResetWarnOptions`:
+ * :c:func:`!PySys_ResetWarnOptions`:
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
The :c:func:`Py_InitializeFromConfig` API should be used with
* Deprecate old Python initialization functions:
- * :c:func:`PySys_ResetWarnOptions`:
+ * :c:func:`!PySys_ResetWarnOptions`:
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
* :c:func:`!Py_GetExecPrefix`:
Get :data:`sys.exec_prefix` instead.
of :c:func:`PyImport_ImportModule`.
(Contributed by Bénédikt Tran in :gh:`133644`.)
+* Remove deprecated :c:func:`!PySys_ResetWarnOptions`.
+ Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
+
+ (Contributed by Nikita Sobolev in :gh:`138886`.)
+
The following functions are removed in favor of :c:func:`PyConfig_Get`.
The |pythoncapi_compat_project| can be used to get :c:func:`!PyConfig_Get`
on Python 3.13 and older.
PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...);
PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...);
-Py_DEPRECATED(3.13) PyAPI_FUNC(void) PySys_ResetWarnOptions(void);
-
PyAPI_FUNC(PyObject *) PySys_GetXOptions(void);
#ifdef __cplusplus
Deprecate old Python initialization functions:
-* :c:func:`PySys_ResetWarnOptions`
+* :c:func:`!PySys_ResetWarnOptions`
* :c:func:`!Py_GetExecPrefix`
* :c:func:`!Py_GetPath`
* :c:func:`!Py_GetPrefix`
--- /dev/null
+Remove deprecated :c:func:`!PySys_ResetWarnOptions` C-API function.
abi_only = true
[function.PySys_ResetWarnOptions]
added = '3.2'
+ abi_only = true
[function.PySys_SetArgv]
added = '3.2'
[function.PySys_SetArgvEx]
extern void PySys_AddXOption(const wchar_t *s);
extern void Py_SetPath(const wchar_t *path);
+// These functions were removed from Python 3.15 API but are still exported
+// for the stable ABI. We want to test them in this program.
+extern void PySys_ResetWarnOptions(void);
+
int main_argc;
char **main_argv;
return warnoptions;
}
-void
+PyAPI_FUNC(void)
PySys_ResetWarnOptions(void)
{
PyThreadState *tstate = _PyThreadState_GET();