Skip to content

Commit 68b9c20

Browse files
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 d168569) Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Petr Viktorin <[email protected]>
1 parent ddc503c commit 68b9c20

File tree

7 files changed

+9
-7
lines changed

7 files changed

+9
-7
lines changed

Doc/data/stable_abi.dat

-1
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,6 @@ var,Py_FileSystemDefaultEncodeErrors,3.10,
783783
var,Py_FileSystemDefaultEncoding,3.2,
784784
function,Py_Finalize,3.2,
785785
function,Py_FinalizeEx,3.6,
786-
function,Py_FrozenMain,3.10,
787786
function,Py_GenericAlias,3.9,
788787
function,Py_GenericAliasType,3.9,
789788
function,Py_GetBuildInfo,3.2,

Doc/whatsnew/3.10.rst

+4
Original file line numberDiff line numberDiff line change
@@ -1926,6 +1926,10 @@ Porting to Python 3.10
19261926
instead.
19271927
(Contributed by Victor Stinner and Erlend E. Aasland in :issue:`43908`.)
19281928
1929+
* The undocumented function ``Py_FrozenMain`` has been removed from the
1930+
limited API. The function is mainly useful for custom builds of Python.
1931+
(Contributed by Petr Viktorin in :issue:`26241`)
1932+
19291933
Deprecated
19301934
----------
19311935

Include/cpython/pylifecycle.h

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# error "this header file must not be included directly"
33
#endif
44

5+
/* Py_FrozenMain is kept out of the Limited API until documented and present
6+
in all builds of Python */
7+
PyAPI_FUNC(int) Py_FrozenMain(int argc, char **argv);
8+
59
/* Only used by applications that embed the interpreter and need to
610
* override the standard encoding determination mechanism
711
*/

Include/pylifecycle.h

-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ PyAPI_FUNC(void) _Py_NO_RETURN Py_Exit(int);
3131

3232
/* Bootstrap __main__ (defined in Modules/main.c) */
3333
PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv);
34-
35-
PyAPI_FUNC(int) Py_FrozenMain(int argc, char **argv);
36-
3734
PyAPI_FUNC(int) Py_BytesMain(int argc, char **argv);
3835

3936
/* In pathconfig.c */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The undocumented function :c:func:`Py_FrozenMain` is removed from the Limited API.

Misc/stable_abi.txt

-2
Original file line numberDiff line numberDiff line change
@@ -2079,8 +2079,6 @@ function PyType_GetModule
20792079
added 3.10
20802080
function PyType_GetModuleState
20812081
added 3.10
2082-
function Py_FrozenMain
2083-
added 3.10
20842082
function PyFrame_GetLineNumber
20852083
added 3.10
20862084
function PyFrame_GetCode

PC/python3dll.c

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ EXPORT_FUNC(Py_Exit)
5555
EXPORT_FUNC(Py_FatalError)
5656
EXPORT_FUNC(Py_Finalize)
5757
EXPORT_FUNC(Py_FinalizeEx)
58-
EXPORT_FUNC(Py_FrozenMain)
5958
EXPORT_FUNC(Py_GenericAlias)
6059
EXPORT_FUNC(Py_GenericAliasType)
6160
EXPORT_FUNC(Py_GetArgcArgv)

0 commit comments

Comments
 (0)