mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
gh-91256: Ensure help text has the program name even before getpath is called (GH-94929)
This commit is contained in:
parent
ea11c17742
commit
49aeff49d7
2 changed files with 4 additions and 0 deletions
|
@ -0,0 +1 @@
|
||||||
|
Ensures the program name is known for help text during interpreter startup.
|
|
@ -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 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue