Skip to content
Prev Previous commit
Next Next commit
Suggest more replacement functions
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
  • Loading branch information
AA-Turner and serhiy-storchaka authored Sep 25, 2023
commit 7312d08ebeb2b0d9af3d45925680dfe26f08f2e9
12 changes: 6 additions & 6 deletions Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2180,12 +2180,12 @@ although there is currently no date scheduled for their removal.
* :c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException`
* :c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`
* :c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject`
* :c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child()`
* :c:func:`PySlice_GetIndicesEx`
* :c:func:`!PyUnicode_AsDecodedObject`
* :c:func:`!PyUnicode_AsDecodedUnicode`
* :c:func:`!PyUnicode_AsEncodedObject`
* :c:func:`!PyUnicode_AsEncodedUnicode`
* :c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child`
* :c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:`PySlice_AdjustIndices`
* :c:func:`!PyUnicode_AsDecodedObject`: use c:func:`PyCodec_Decode`
* :c:func:`!PyUnicode_AsDecodedUnicode`: use c:func:`PyCodec_Decode`
* :c:func:`!PyUnicode_AsEncodedObject`: use c:func:`PyCodec_Encode`
* :c:func:`!PyUnicode_AsEncodedUnicode`: use c:func:`PyCodec_Encode`
Comment thread
AA-Turner marked this conversation as resolved.
Outdated
* :c:func:`PyUnicode_READY`: unneeded since Python 3.12
* :c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException`
* :c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1``

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about this. It is an internal convenient function, and it can be removed or changed in incompatible way without warning.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're recommending a private replacement to a private function here, so I think it's fine. This isn't saying that readers should use the functions, just what the replacements for the deprecated versions are.

Expand Down