mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-91256: Ensure help text has the program name even before getpath is called (GH-94929)
(cherry picked from commit 49aeff49d7
)
Co-authored-by: Steve Dower <steve.dower@python.org>
This commit is contained in:
parent
9487e8d250
commit
bb8e20a329
2 changed files with 4 additions and 0 deletions
|
@ -0,0 +1 @@
|
||||||
|
Ensures the program name is known for help text during interpreter startup.
|
|
@ -2295,6 +2295,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