diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-05-25 04:59:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-25 12:59:10 +0100 |
commit | 68b9c20a98887bf0a92698f8df9f28b9440970dc (patch) | |
tree | b1aa28c80b140271d77421352c3241f62fe6c04f | |
parent | ddc503c8d20c4893e69b5bf466ad85da6a3f0be6 (diff) | |
download | cpython-git-68b9c20a98887bf0a92698f8df9f28b9440970dc.tar.gz |
bpo-43795: Remove Py_FrozenMain from the Limited API & Stable ABI (GH-26241) (GH-26353)
Py_FrozenMain was added to the Limited C API in [bpo-42591]() (3.10.0a4);
but to fix that issue it would be enough to add it to the regular C API.
The function is undocumented, tests were added very recently ([bpo-44131]()),
and most importantly, it is not present in all builds of Python, as
the linker sometimes omits it as unused.
It should be added back when these issues are fixed.
Note that this does not affect Python's regular C API.
(cherry picked from commit d16856960e33bc5f64fc5b842f132058becafa37)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
-rw-r--r-- | Doc/data/stable_abi.dat | 1 | ||||
-rw-r--r-- | Doc/whatsnew/3.10.rst | 4 | ||||
-rw-r--r-- | Include/cpython/pylifecycle.h | 4 | ||||
-rw-r--r-- | Include/pylifecycle.h | 3 | ||||
-rw-r--r-- | Misc/NEWS.d/next/C API/2021-05-19-15-09-47.bpo-43795.WAHRxt.rst | 1 | ||||
-rw-r--r-- | Misc/stable_abi.txt | 2 | ||||
-rwxr-xr-x | PC/python3dll.c | 1 |
7 files changed, 9 insertions, 7 deletions
diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat index d582204f56..50207ac91e 100644 --- a/Doc/data/stable_abi.dat +++ b/Doc/data/stable_abi.dat @@ -783,7 +783,6 @@ var,Py_FileSystemDefaultEncodeErrors,3.10, var,Py_FileSystemDefaultEncoding,3.2, function,Py_Finalize,3.2, function,Py_FinalizeEx,3.6, -function,Py_FrozenMain,3.10, function,Py_GenericAlias,3.9, function,Py_GenericAliasType,3.9, function,Py_GetBuildInfo,3.2, diff --git a/Doc/whatsnew/3.10.rst b/Doc/whatsnew/3.10.rst index b83e756e55..96565c3367 100644 --- a/Doc/whatsnew/3.10.rst +++ b/Doc/whatsnew/3.10.rst @@ -1926,6 +1926,10 @@ Porting to Python 3.10 instead. (Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.) +* The undocumented function ``Py_FrozenMain`` has been removed from the + limited API. The function is mainly useful for custom builds of Python. + (Contributed by Petr Viktorin in :issue:`26241`) + Deprecated ---------- diff --git a/Include/cpython/pylifecycle.h b/Include/cpython/pylifecycle.h index 13f7a26ba1..5faeb3533b 100644 --- a/Include/cpython/pylifecycle.h +++ b/Include/cpython/pylifecycle.h @@ -2,6 +2,10 @@ # error "this header file must not be included directly" #endif +/* Py_FrozenMain is kept out of the Limited API until documented and present + in all builds of Python */ +PyAPI_FUNC(int) Py_FrozenMain(int argc, char **argv); + /* Only used by applications that embed the interpreter and need to * override the standard encoding determination mechanism */ diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h index 783fcb455e..2df7fe6e3c 100644 --- a/Include/pylifecycle.h +++ b/Include/pylifecycle.h @@ -31,9 +31,6 @@ PyAPI_FUNC(void) _Py_NO_RETURN Py_Exit(int); /* Bootstrap __main__ (defined in Modules/main.c) */ PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv); - -PyAPI_FUNC(int) Py_FrozenMain(int argc, char **argv); - PyAPI_FUNC(int) Py_BytesMain(int argc, char **argv); /* In pathconfig.c */ diff --git a/Misc/NEWS.d/next/C API/2021-05-19-15-09-47.bpo-43795.WAHRxt.rst b/Misc/NEWS.d/next/C API/2021-05-19-15-09-47.bpo-43795.WAHRxt.rst new file mode 100644 index 0000000000..23db2330ac --- /dev/null +++ b/Misc/NEWS.d/next/C API/2021-05-19-15-09-47.bpo-43795.WAHRxt.rst @@ -0,0 +1 @@ +The undocumented function :c:func:`Py_FrozenMain` is removed from the Limited API. diff --git a/Misc/stable_abi.txt b/Misc/stable_abi.txt index a78bcb76b4..adee1a9fe7 100644 --- a/Misc/stable_abi.txt +++ b/Misc/stable_abi.txt @@ -2079,8 +2079,6 @@ function PyType_GetModule added 3.10 function PyType_GetModuleState added 3.10 -function Py_FrozenMain - added 3.10 function PyFrame_GetLineNumber added 3.10 function PyFrame_GetCode diff --git a/PC/python3dll.c b/PC/python3dll.c index 200d1d14e2..be85f27e72 100755 --- a/PC/python3dll.c +++ b/PC/python3dll.c @@ -55,7 +55,6 @@ EXPORT_FUNC(Py_Exit) EXPORT_FUNC(Py_FatalError) EXPORT_FUNC(Py_Finalize) EXPORT_FUNC(Py_FinalizeEx) -EXPORT_FUNC(Py_FrozenMain) EXPORT_FUNC(Py_GenericAlias) EXPORT_FUNC(Py_GenericAliasType) EXPORT_FUNC(Py_GetArgcArgv) |