summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na@python.org>2021-05-13 01:19:46 (GMT)
committerGitHub <noreply@github.com>2021-05-13 01:19:46 (GMT)
commit7565586724692e2ad164d770af9675f7a261fe3a (patch)
treed820987b1f47cef6475f786f637d3f9c1473fe49
parentec7c09b9bc9a8f333a0295b41ea88986c320448c (diff)
downloadcpython-7565586724692e2ad164d770af9675f7a261fe3a.zip
cpython-7565586724692e2ad164d770af9675f7a261fe3a.tar.gz
cpython-7565586724692e2ad164d770af9675f7a261fe3a.tar.bz2
bpo-44113: Update fromzenmain not to use Py_SetProgramName (GH-26085)
-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);