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

This commit is contained in:
Steve Dower 2022-07-19 19:39:11 +01:00 committed by GitHub
parent ea11c17742
commit 49aeff49d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -0,0 +1 @@
Ensures the program name is known for help text during interpreter startup.

View File

@ -2310,6 +2310,9 @@ config_parse_cmdline(PyConfig *config, PyWideStringList *warnoptions,
const PyWideStringList *argv = &config->argv; const PyWideStringList *argv = &config->argv;
int print_version = 0; int print_version = 0;
const wchar_t* program = config->program_name; const wchar_t* program = config->program_name;
if (!program && argv->length >= 1) {
program = argv->items[0];
}
_PyOS_ResetGetOpt(); _PyOS_ResetGetOpt();
do { do {