summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/frozenmain.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Python/frozenmain.c b/Python/frozenmain.c
index dd04d60..5eb9e31 100644
--- a/Python/frozenmain.c
+++ b/Python/frozenmain.c
@@ -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);