diff --git a/Lib/argparse.py b/Lib/argparse.py index cdd29d3ad568e5..efcf4bd3a5d357 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -599,9 +599,7 @@ def _iter_indented_subactions(self, action): except AttributeError: pass else: - self._indent() yield from get_subactions() - self._dedent() def _split_lines(self, text, width): text = self._whitespace_matcher.sub(' ', text).strip() diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py index eb1a9f5146beb4..0821027d9c9987 100644 --- a/Lib/test/test_argparse.py +++ b/Lib/test/test_argparse.py @@ -2447,9 +2447,9 @@ def test_parser_command_help(self): positional arguments: bar bar help {1,2,3} command help - 1 1 help - 2 2 help - 3 3 help + 1 1 help + 2 2 help + 3 3 help options: -h, --help show this help message and exit @@ -2552,10 +2552,9 @@ def test_alias_help(self): commands: COMMAND - 1 (1alias1, 1alias2) - 1 help - 2 2 help - 3 3 help + 1 (1alias1, 1alias2) 1 help + 2 2 help + 3 3 help """)) # ============ @@ -4872,11 +4871,11 @@ class TestHelpSubparsersWithHelpOrdering(HelpTestCase): positional arguments: {a,b,c,d,e} - a a subcommand help - b b subcommand help - c c subcommand help - d d subcommand help - e e subcommand help + a a subcommand help + b b subcommand help + c c subcommand help + d d subcommand help + e e subcommand help options: -h, --help show this help message and exit