diff options
author | Dong-hee Na <donghee.na@python.org> | 2021-05-13 01:19:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-13 01:19:46 (GMT) |
commit | 7565586724692e2ad164d770af9675f7a261fe3a (patch) | |
tree | d820987b1f47cef6475f786f637d3f9c1473fe49 /Python/frozenmain.c | |
parent | ec7c09b9bc9a8f333a0295b41ea88986c320448c (diff) | |
download | cpython-7565586724692e2ad164d770af9675f7a261fe3a.zip cpython-7565586724692e2ad164d770af9675f7a261fe3a.tar.gz cpython-7565586724692e2ad164d770af9675f7a261fe3a.tar.bz2 |
bpo-44113: Update fromzenmain not to use Py_SetProgramName (GH-26085)
Diffstat (limited to 'Python/frozenmain.c')
-rw-r--r-- | Python/frozenmain.c | 10 |
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); |