bpo-44113: Update fromzenmain not to use Py_SetProgramName (GH-26085)

This commit is contained in:
Dong-hee Na 2021-05-13 10:19:46 +09:00 committed by GitHub
parent ec7c09b9bc
commit 7565586724
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,8 +78,14 @@ Py_FrozenMain(int argc, char **argv)
#ifdef MS_WINDOWS
PyInitFrozenExtensions();
#endif /* MS_WINDOWS */
if (argc >= 1)
Py_SetProgramName(argv_copy[0]);
if (argc >= 1) {
status = PyConfig_SetString(&config, &config.program_name,
argv_copy[0]);
if (PyStatus_Exception(status)) {
PyConfig_Clear(&config);
Py_ExitStatusException(status);
}
}
status = Py_InitializeFromConfig(&config);
PyConfig_Clear(&config);