summaryrefslogtreecommitdiffstats
path: root/Lib/argparse.py
diff options
context:
space:
mode:
authorPayton <72841140+paytonward6@users.noreply.github.com>2024-09-24 14:14:35 (GMT)
committerGitHub <noreply@github.com>2024-09-24 14:14:35 (GMT)
commitd21b0b5d36834d4d35aec3a01661597019594936 (patch)
tree93a77ac4e1b78c595e54c4f59dc283de20070d4c /Lib/argparse.py
parent4a5e4aade420c594c5b3fe0589e9e6b444bd6ee5 (diff)
downloadcpython-d21b0b5d36834d4d35aec3a01661597019594936.zip
cpython-d21b0b5d36834d4d35aec3a01661597019594936.tar.gz
cpython-d21b0b5d36834d4d35aec3a01661597019594936.tar.bz2
gh-113008: Correct argparse usage output for required, mutually exclusive groups (GH-113085)
Diffstat (limited to 'Lib/argparse.py')
-rw-r--r--Lib/argparse.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py
index 66192fb..694c46d 100644
--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -395,12 +395,12 @@ class HelpFormatter(object):
continue
try:
- start = actions.index(group._group_actions[0])
+ start = min(actions.index(item) for item in group._group_actions)
except ValueError:
continue
else:
end = start + len(group._group_actions)
- if actions[start:end] == group._group_actions:
+ if set(actions[start:end]) == set(group._group_actions):
group_actions.update(group._group_actions)
inserts[start, end] = group