diff options
author | Steve Dower <steve.dower@python.org> | 2022-07-19 18:39:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-19 18:39:11 (GMT) |
commit | 49aeff49d71fa4bd935212340410311f13879447 (patch) | |
tree | f69091d84944f8754d68ea91f4237cf1139e1a42 /Python/initconfig.c | |
parent | ea11c1774274aa9f4d6eee863d37632aa79a0ace (diff) | |
download | cpython-49aeff49d71fa4bd935212340410311f13879447.zip cpython-49aeff49d71fa4bd935212340410311f13879447.tar.gz cpython-49aeff49d71fa4bd935212340410311f13879447.tar.bz2 |
gh-91256: Ensure help text has the program name even before getpath is called (GH-94929)
Diffstat (limited to 'Python/initconfig.c')
-rw-r--r-- | Python/initconfig.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/initconfig.c b/Python/initconfig.c index 355f986..d29c693 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -2310,6 +2310,9 @@ config_parse_cmdline(PyConfig *config, PyWideStringList *warnoptions, const PyWideStringList *argv = &config->argv; int print_version = 0; const wchar_t* program = config->program_name; + if (!program && argv->length >= 1) { + program = argv->items[0]; + } _PyOS_ResetGetOpt(); do { |