Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1641,18 +1641,12 @@ Py_InitializeFromConfig(const PyConfig *config)
void
Py_InitializeEx(int install_sigs)
{
PyStatus status;

status = _PyRuntime_Initialize();
Copy link
Copy Markdown
Contributor Author

@AraHaan AraHaan Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since Py_InitializeFromConfig is called in Py_InitializeEx, this can be deferred to that call & avoids needless code duplication & wasted clock cycles on startup.

if (_PyStatus_EXCEPTION(status)) {
Py_ExitStatusException(status);
}

if (Py_IsInitialized()) {
/* bpo-33932: Calling Py_Initialize() twice does nothing. */
return;
}

PyStatus status;
PyConfig config;
_PyConfig_InitCompatConfig(&config);

Expand Down
Loading