Skip to content

Commit d168569

Browse files
authored
bpo-43795: Remove Py_FrozenMain from the Limited API & Stable ABI (GH-26241)
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.
1 parent 63f17c2 commit d168569

File tree

7 files changed

+9
-7
lines changed

7 files changed

+9
-7
lines changed

Doc/data/stable_abi.dat

Lines changed: 0 additions & 1 deletion
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

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

Include/cpython/pylifecycle.h

Lines changed: 4 additions & 0 deletions
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

Lines changed: 0 additions & 3 deletions
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 */
Lines changed: 1 addition & 0 deletions
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

Lines changed: 0 additions & 2 deletions
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

Lines changed: 0 additions & 1 deletion
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)