summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-07-19 19:03:15 (GMT)
committerGitHub <noreply@github.com>2022-07-19 19:03:15 (GMT)
commitbb8e20a329f83cdeb74e5a6cc5a4079349ba2a87 (patch)
tree5a872d297d6c0a3cf976dedb5a50d99e62eade0b /Python
parent9487e8d250783b48eec1d240eddac809584e11a0 (diff)
downloadcpython-bb8e20a329f83cdeb74e5a6cc5a4079349ba2a87.zip
cpython-bb8e20a329f83cdeb74e5a6cc5a4079349ba2a87.tar.gz
cpython-bb8e20a329f83cdeb74e5a6cc5a4079349ba2a87.tar.bz2
gh-91256: Ensure help text has the program name even before getpath is called (GH-94929)
(cherry picked from commit 49aeff49d71fa4bd935212340410311f13879447) Co-authored-by: Steve Dower <steve.dower@python.org>
Diffstat (limited to 'Python')
-rw-r--r--Python/initconfig.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/initconfig.c b/Python/initconfig.c
index 86dcdd9..d313850 100644
--- a/Python/initconfig.c
+++ b/Python/initconfig.c
@@ -2295,6 +2295,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 {