diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-11-22 17:29:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-22 17:29:33 +0200 |
commit | 0cb4d6c6549d2299f7518f083bbe7d10314ecd66 (patch) | |
tree | 702b9453efd01031b859fb14281a03da30bc9394 /Lib/argparse.py | |
parent | 46f8a7bbdbb02cafaa00f7bb9478d3d27affc57a (diff) | |
download | cpython-0cb4d6c6549d2299f7518f083bbe7d10314ecd66.tar.gz cpython-0cb4d6c6549d2299f7518f083bbe7d10314ecd66.zip |
gh-86463: Fix default prog in subparsers if usage is used in the main parser (GH-125891)
The usage parameter of argparse.ArgumentParser no longer
affects the default value of the prog parameter in subparsers.
Previously the full custom usage of the main parser was used as
the prog prefix in subparsers.
Diffstat (limited to 'Lib/argparse.py')
-rw-r--r-- | Lib/argparse.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py index 5ecfdca1717..f5a7342c2fc 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -1889,7 +1889,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): formatter = self._get_formatter() positionals = self._get_positional_actions() groups = self._mutually_exclusive_groups - formatter.add_usage(self.usage, positionals, groups, '') + formatter.add_usage(None, positionals, groups, '') kwargs['prog'] = formatter.format_help().strip() # create the parsers action and add it to the positionals list |