https://github.com/python/cpython/commit/789120e82609a50a94c683a62d043f89e383d23f
commit: 789120e82609a50a94c683a62d043f89e383d23f
branch: main
author: AraHaan <[email protected]>
committer: ZeroIntensity <[email protected]>
date: 2026-04-20T10:01:06-04:00
summary:
gh-148790: Eliminate redundant call to `_PyRuntime_Initialize` in
`Py_InitializeEx` (GH-121628)
files:
M Python/pylifecycle.c
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index d9fc28475a489d..0232ed6c382c61 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -1641,18 +1641,12 @@ Py_InitializeFromConfig(const PyConfig *config)
void
Py_InitializeEx(int install_sigs)
{
- PyStatus status;
-
- status = _PyRuntime_Initialize();
- 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);
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]