diff options
author | steven.bethard <devnull@localhost> | 2009-04-30 15:32:42 +0000 |
---|---|---|
committer | steven.bethard <devnull@localhost> | 2009-04-30 15:32:42 +0000 |
commit | 5465e04e5572379b0ee95abebe4567f976035caa (patch) | |
tree | 8012605cfe92c6627f57391e91330d5d06f0b3bc /argparse.py | |
parent | f1cfd4836ece12289c4bec4c5d36caf452268d3d (diff) | |
download | argparse-5465e04e5572379b0ee95abebe4567f976035caa.tar.gz |
Fix bug with wrapping mutually exclusive groups in the usage message.
Diffstat (limited to 'argparse.py')
-rw-r--r-- | argparse.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/argparse.py b/argparse.py index a57c923..5ffcd42 100644 --- a/argparse.py +++ b/argparse.py @@ -338,8 +338,11 @@ class HelpFormatter(object): group_actions = set()
inserts = {}
for group in groups:
- start = actions.index(group._group_actions[0])
- if start != -1:
+ try:
+ start = actions.index(group._group_actions[0])
+ except ValueError:
+ continue
+ else:
end = start + len(group._group_actions)
if actions[start:end] == group._group_actions:
for action in group._group_actions:
|