Skip to content

gh-158080: Py_InitializeFromConfig() no longer exits Python - #158085

Merged
vstinner merged 5 commits into
python:mainfrom
vstinner:defer_option
Sep 25, 2026
Merged

vstinner merged 5 commits into
python:mainfrom
vstinner:defer_option

Conversation

@vstinner

@vstinner vstinner commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

If a command line option wants to exit Python, move this option processing from PyConfig_Read() to Py_Main(). So
Py_InitializeFromInitConfig() and Py_InitializeFromConfig() can no longer return an exit code.

Deprecate PyInitConfig_GetExitCode(), PyStatus_Exit(), and PyStatus_IsExit()
functions, and PyStatus.exitcode member.

Renumber getopt.c long options to start at 1, instead of 0.

If a command line option wants to exit Python, move this option
processing from PyConfig_Read() to Py_Main(). So
Py_InitializeFromInitConfig() and Py_InitializeFromConfig() can no
longer return an exit code.

Renumber getopt.c long options to start at 1, instead of 0.
@read-the-docs-community

read-the-docs-community Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

@vstinner
vstinner enabled auto-merge (squash) September 25, 2026 11:01
@vstinner
vstinner merged commit fe7717c into python:main Sep 25, 2026
55 checks passed
@vstinner
vstinner deleted the defer_option branch September 25, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant