@@ -116,15 +116,14 @@ Error Handling
116116
117117 Get the *config * exit code.
118118
119- * Set *\* exitcode * and return ``1 `` if *config * has an exit code set.
120- * Return ``0 `` if *config * has no exit code set.
119+ Return ``0 `` and leave *\* exitcode * unchanged.
121120
122- Only the ``Py_InitializeFromInitConfig() `` function can set an exit
123- code if the ``parse_argv `` option is non-zero.
121+ In Python 3.15, :c:func: `Py_InitializeFromInitConfig ` sets an exit code if a
122+ command line option wants to exit Python. This is no longer the case in
123+ Python 3.16. Instead, the option is now processed in :c:func: `Py_RunMain `.
124+ This function became useless.
124125
125- An exit code can be set when parsing the command line failed (exit
126- code ``2 ``) or when a command line option asks to display the command
127- line help (exit code ``0 ``).
126+ .. deprecated :: next
128127
129128
130129Get Options
@@ -247,10 +246,11 @@ Initialize Python
247246
248247 * Return ``0 `` on success.
249248 * Set an error in *config * and return ``-1 `` on error.
250- * Set an exit code in *config * and return ``-1 `` if Python wants to
251- exit.
252249
253- See ``PyInitConfig_GetExitcode() `` for the exit code case.
250+ .. versionchanged :: next
251+ The function no longer sets an exit code if a command line option wants
252+ to exit Python. Instead, the option is now processed in
253+ :c:func: `Py_RunMain `.
254254
255255
256256.. _pyinitconfig-opts :
@@ -690,9 +690,6 @@ Example of customized Python always running in isolated mode::
690690
691691 exception:
692692 PyConfig_Clear(&config);
693- if (PyStatus_IsExit(status)) {
694- return status.exitcode ;
695- }
696693 /* Display the error message and exit the process with
697694 non-zero exit code */
698695 Py_ExitStatusException (status);
@@ -758,6 +755,8 @@ PyStatus
758755
759756 Exit code. Argument passed to ``exit() ``.
760757
758+ .. deprecated :: next
759+
761760 .. c :member :: const char *err_msg
762761
763762 Error message.
@@ -788,6 +787,11 @@ PyStatus
788787
789788 Exit Python with the specified exit code.
790789
790+ .. deprecated:: next
791+ :c:func:`Py_InitializeFromConfig` no longer sets an exit code if a
792+ command line option wants to exit Python. Instead, the option is
793+ now processed in :c:func:`Py_RunMain`.
794+
791795 Functions to handle a status:
792796
793797 .. c:function:: int PyStatus_Exception(PyStatus status)
@@ -803,6 +807,11 @@ PyStatus
803807
804808 Is the result an exit?
805809
810+ .. deprecated:: next
811+ :c:func:`Py_InitializeFromConfig` no longer sets an exit code if a
812+ command line option wants to exit Python. Instead, the option is
813+ now processed in :c:func:`Py_RunMain`.
814+
806815 .. c:function:: void Py_ExitStatusException(PyStatus status)
807816
808817 Call ``exit(exitcode)`` if *status* is an exit. Print the error
0 commit comments