]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43795: Remove Py_FrozenMain from the Limited API & Stable ABI (GH-26241)
authorPetr Viktorin <encukou@gmail.com>
Tue, 25 May 2021 11:42:03 +0000 (13:42 +0200)
committerGitHub <noreply@github.com>
Tue, 25 May 2021 11:42:03 +0000 (04:42 -0700)
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.

Doc/data/stable_abi.dat
Doc/whatsnew/3.10.rst
Include/cpython/pylifecycle.h
Include/pylifecycle.h
Misc/NEWS.d/next/C API/2021-05-19-15-09-47.bpo-43795.WAHRxt.rst [new file with mode: 0644]
Misc/stable_abi.txt
PC/python3dll.c

index d582204f5626b9c739f672c9de2cc794fe444a25..50207ac91ec8a86b1435a79f2b27985125393752 100644 (file)
@@ -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,
index a006eb4d6c534f49a3e91778ea6c9192036e2f4e..233ee8b201f0e65790ef3c4686856e166b23b2dd 100644 (file)
@@ -1927,6 +1927,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
 ----------
 
index 6fe46a544016f47385a9a36b69a07dd1fd6c78fe..bb5b07ef5901c82c2df0e5c965166b6fe56609b1 100644 (file)
@@ -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
  */
index 7925eafc660474ca5ce697a9c37318308e13bc76..9b2dd0868eb25b9d5ced3dc9838e5f75950afb12 100644 (file)
@@ -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 (file)
index 0000000..23db233
--- /dev/null
@@ -0,0 +1 @@
+The undocumented function :c:func:`Py_FrozenMain` is removed from the Limited API.
index a78bcb76b41df693f1c71ad670438ee8ee64ec43..adee1a9fe730359f0a9efba6a306716f47eb4db1 100644 (file)
@@ -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
index 200d1d14e294d18c75ad224041edc050ff5c1ee9..be85f27e72ac81c201f758b72afb5cbc20261eb8 100755 (executable)
@@ -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)