From d8357451b16e892ab49e6987c7016c08a724c927 Mon Sep 17 00:00:00 2001 From: Savannah Ostrowski Date: Sat, 23 Nov 2024 19:09:09 -0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> --- Lib/argparse.py | 4 ++-- Lib/test/test_argparse.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/argparse.py b/Lib/argparse.py index 5cc52c3490ddea..d24fa72e573d4f 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -1709,7 +1709,7 @@ def _remove_action(self, action): self._group_actions.remove(action) def add_argument_group(self, *args, **kwargs): - raise ValueError('nested argument groups are not supported') + raise ValueError('argument groups cannot be nested') class _MutuallyExclusiveGroup(_ArgumentGroup): @@ -1731,7 +1731,7 @@ def _remove_action(self, action): self._group_actions.remove(action) def add_mutually_exclusive_group(self, **kwargs): - raise ValueError('nested mutually exclusive groups are not supported') + raise ValueError('mutually exclusive groups cannot be nested') def _prog_name(prog=None): if prog is not None: diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py index c3b7d741f144b0..4f886d28bcb67d 100644 --- a/Lib/test/test_argparse.py +++ b/Lib/test/test_argparse.py @@ -3310,7 +3310,7 @@ def test_nested_mutex_groups(self): g.add_argument("--spam") self.assertRaisesRegex(ValueError, 'nested mutually exclusive groups are not supported', - g.add_mutually_exclusive_group) + g.add_mutually_exclusive_group) class MEMixin(object):