Skip to content

Commit baf7470

Browse files
authored
gh-138886: Remove deprecated PySys_ResetWarnOptions C-API function (#138887)
1 parent 097fc12 commit baf7470

File tree

12 files changed

+15
-16
lines changed

12 files changed

+15
-16
lines changed

Doc/c-api/init.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ The following functions can be safely called before Python is initialized:
4141
* :c:func:`PyObject_SetArenaAllocator`
4242
* :c:func:`Py_SetProgramName`
4343
* :c:func:`Py_SetPythonHome`
44-
* :c:func:`PySys_ResetWarnOptions`
4544
* the configuration functions covered in :ref:`init-config`
4645

4746
* Informative functions:

Doc/c-api/sys.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,6 @@ accessible to C code. They all work with the current interpreter thread's
316316
case *name* is deleted from the sys module. Returns ``0`` on success, ``-1``
317317
on error.
318318
319-
.. c:function:: void PySys_ResetWarnOptions()
320-
321-
Reset :data:`sys.warnoptions` to an empty list. This function may be
322-
called prior to :c:func:`Py_Initialize`.
323-
324-
.. deprecated-removed:: 3.13 3.15
325-
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
326-
327319
.. c:function:: void PySys_WriteStdout(const char *format, ...)
328320
329321
Write the output string described by *format* to :data:`sys.stdout`. No

Doc/data/stable_abi.dat

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Doc/deprecations/c-api-pending-removal-in-3.15.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Pending removal in Python 3.15
5959
Set :c:member:`PyConfig.program_name` instead.
6060
* :c:func:`!Py_SetPythonHome()`:
6161
Set :c:member:`PyConfig.home` instead.
62-
* :c:func:`PySys_ResetWarnOptions`:
62+
* :c:func:`!PySys_ResetWarnOptions`:
6363
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
6464

6565
The :c:func:`Py_InitializeFromConfig` API should be used with

Doc/whatsnew/3.13.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2490,7 +2490,7 @@ Deprecated C APIs
24902490

24912491
* Deprecate old Python initialization functions:
24922492

2493-
* :c:func:`PySys_ResetWarnOptions`:
2493+
* :c:func:`!PySys_ResetWarnOptions`:
24942494
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
24952495
* :c:func:`!Py_GetExecPrefix`:
24962496
Get :data:`sys.exec_prefix` instead.

Doc/whatsnew/3.15.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,11 @@ Removed C APIs
815815
of :c:func:`PyImport_ImportModule`.
816816
(Contributed by Bénédikt Tran in :gh:`133644`.)
817817

818+
* Remove deprecated :c:func:`!PySys_ResetWarnOptions`.
819+
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
820+
821+
(Contributed by Nikita Sobolev in :gh:`138886`.)
822+
818823
The following functions are removed in favor of :c:func:`PyConfig_Get`.
819824
The |pythoncapi_compat_project| can be used to get :c:func:`!PyConfig_Get`
820825
on Python 3.13 and older.

Include/sysmodule.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...)
2323
PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...);
2424
PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...);
2525

26-
Py_DEPRECATED(3.13) PyAPI_FUNC(void) PySys_ResetWarnOptions(void);
27-
2826
PyAPI_FUNC(PyObject *) PySys_GetXOptions(void);
2927

3028
#ifdef __cplusplus

Misc/NEWS.d/3.13.0a1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6592,7 +6592,7 @@ functions, deprecated in Python 3.9. Patch by Victor Stinner.
65926592
65936593
Deprecate old Python initialization functions:
65946594

6595-
* :c:func:`PySys_ResetWarnOptions`
6595+
* :c:func:`!PySys_ResetWarnOptions`
65966596
* :c:func:`!Py_GetExecPrefix`
65976597
* :c:func:`!Py_GetPath`
65986598
* :c:func:`!Py_GetPrefix`
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove deprecated :c:func:`!PySys_ResetWarnOptions` C-API function.

Misc/stable_abi.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,7 @@
13351335
abi_only = true
13361336
[function.PySys_ResetWarnOptions]
13371337
added = '3.2'
1338+
abi_only = true
13381339
[function.PySys_SetArgv]
13391340
added = '3.2'
13401341
[function.PySys_SetArgvEx]

0 commit comments

Comments
 (0)