Skip to content

Commit 49aeff4

Browse files
authored
gh-91256: Ensure help text has the program name even before getpath is called (GH-94929)
1 parent ea11c17 commit 49aeff4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ensures the program name is known for help text during interpreter startup.

Python/initconfig.c

+3
Original file line numberDiff line numberDiff line change
@@ -2310,6 +2310,9 @@ config_parse_cmdline(PyConfig *config, PyWideStringList *warnoptions,
23102310
const PyWideStringList *argv = &config->argv;
23112311
int print_version = 0;
23122312
const wchar_t* program = config->program_name;
2313+
if (!program && argv->length >= 1) {
2314+
program = argv->items[0];
2315+
}
23132316

23142317
_PyOS_ResetGetOpt();
23152318
do {

0 commit comments

Comments
 (0)