diff options
Diffstat (limited to 'Lib/argparse.py')
-rw-r--r-- | Lib/argparse.py | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py index f5a7342..d24fa72 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -1709,14 +1709,7 @@ class _ArgumentGroup(_ActionsContainer): self._group_actions.remove(action) def add_argument_group(self, *args, **kwargs): - import warnings - warnings.warn( - "Nesting argument groups is deprecated.", - category=DeprecationWarning, - stacklevel=2 - ) - return super().add_argument_group(*args, **kwargs) - + raise ValueError('argument groups cannot be nested') class _MutuallyExclusiveGroup(_ArgumentGroup): @@ -1737,15 +1730,8 @@ class _MutuallyExclusiveGroup(_ArgumentGroup): self._container._remove_action(action) self._group_actions.remove(action) - def add_mutually_exclusive_group(self, *args, **kwargs): - import warnings - warnings.warn( - "Nesting mutually exclusive groups is deprecated.", - category=DeprecationWarning, - stacklevel=2 - ) - return super().add_mutually_exclusive_group(*args, **kwargs) - + def add_mutually_exclusive_group(self, **kwargs): + raise ValueError('mutually exclusive groups cannot be nested') def _prog_name(prog=None): if prog is not None: |