gh-91256: Ensure help text has the program name even before getpath is called (GH-94929)

(cherry picked from commit 49aeff49d7)

Co-authored-by: Steve Dower <steve.dower@python.org>
This commit is contained in:
Miss Islington (bot) 2022-07-19 12:03:15 -07:00 committed by GitHub
parent 9487e8d250
commit bb8e20a329
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -2295,6 +2295,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 {