summaryrefslogtreecommitdiffstats
path: root/Lib/argparse.py
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2021-12-15 10:08:26 (GMT)
committerGitHub <noreply@github.com>2021-12-15 10:08:26 (GMT)
commit86de99588db3beff964137f4fe27dd1077a09b35 (patch)
tree08f7eb50ed9a1d7bdc23d0be4795632716548ae4 /Lib/argparse.py
parentf54fee7f37563fbd569596cf94aad023ac6c3179 (diff)
downloadcpython-86de99588db3beff964137f4fe27dd1077a09b35.zip
cpython-86de99588db3beff964137f4fe27dd1077a09b35.tar.gz
cpython-86de99588db3beff964137f4fe27dd1077a09b35.tar.bz2
bpo-26952: [argparse] clearer error when formatting an empty mutually… (GH-30099)
Diffstat (limited to 'Lib/argparse.py')
-rw-r--r--Lib/argparse.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py
index b44fa4f..8a81801 100644
--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -392,6 +392,9 @@ class HelpFormatter(object):
group_actions = set()
inserts = {}
for group in groups:
+ if not group._group_actions:
+ raise ValueError(f'empty group {group}')
+
try:
start = actions.index(group._group_actions[0])
except ValueError: