aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/argparse.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/argparse.py')
-rw-r--r--Lib/argparse.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py
index 8a81801ba92..de95eedbee0 100644
--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -89,6 +89,8 @@ import os as _os
import re as _re
import sys as _sys
+import warnings
+
from gettext import gettext as _, ngettext
SUPPRESS = '==SUPPRESS=='
@@ -1648,6 +1650,14 @@ class _ArgumentGroup(_ActionsContainer):
super(_ArgumentGroup, self)._remove_action(action)
self._group_actions.remove(action)
+ def add_argument_group(self, *args, **kwargs):
+ warnings.warn(
+ "Nesting argument groups is deprecated.",
+ category=DeprecationWarning,
+ stacklevel=2
+ )
+ return super().add_argument_group(*args, **kwargs)
+
class _MutuallyExclusiveGroup(_ArgumentGroup):
@@ -1668,6 +1678,14 @@ class _MutuallyExclusiveGroup(_ArgumentGroup):
self._container._remove_action(action)
self._group_actions.remove(action)
+ def add_mutually_exclusive_group(self, *args, **kwargs):
+ warnings.warn(
+ "Nesting mutually exclusive groups is deprecated.",
+ category=DeprecationWarning,
+ stacklevel=2
+ )
+ return super().add_mutually_exclusive_group(*args, **kwargs)
+
class ArgumentParser(_AttributeHolder, _ActionsContainer):
"""Object for parsing command line strings into Python objects.