8000 gh-91256: Ensure help text has the program name even before getpath i… · python/cpython@bb8e20a · GitHub
[go: up one dir, main page]

Skip to content

Commit bb8e20a

Browse files
gh-91256: Ensure help text has the program name even before getpath is called (GH-94929)
(cherry picked from commit 49aeff4) Co-authored-by: Steve Dower <steve.dower@python.org>
1 parent 9487e8d commit bb8e20a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
Lines changed: 1 addition & 0 deletions
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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2295,6 +2295,9 @@ config_parse_cmdline(PyConfig *config, PyWideStringList *warnoptions,
22952295
const PyWideStringList *argv = &config->argv;
22962296
int print_version = 0;
22972297
const wchar_t* program = config->program_name;
2298+
if (!program && argv->length >= 1) {
2299+
program = argv->items[0];
2300+
}
22982301

22992302
_PyOS_ResetGetOpt();
23002303
do {

0 commit comments

Comments
 (0)
0