Skip to content

Commit

Permalink
gh-91256: Ensure help text has the program name even before getpath i…
Browse files Browse the repository at this point in the history
…s called (GH-94929)
  • Loading branch information
zooba authored Jul 19, 2022
1 parent ea11c17 commit 49aeff4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ensures the program name is known for help text during interpreter startup.
3 changes: 3 additions & 0 deletions Python/initconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 49aeff4

Please sign in to comment.