mirror of
https://github.com/python/cpython.git
synced 2025-08-09 19:38:42 +00:00
[3.8] bpo-29553: Fix ArgumentParser.format_usage() for mutually exclusive groups (GH-14976) (GH-15494) (GH-15624)
This commit is contained in:
parent
4bd1d05ee2
commit
bd8ca9aacc
2 changed files with 48 additions and 2 deletions
|
@ -405,13 +405,19 @@ class HelpFormatter(object):
|
|||
inserts[start] += ' ['
|
||||
else:
|
||||
inserts[start] = '['
|
||||
inserts[end] = ']'
|
||||
if end in inserts:
|
||||
inserts[end] += ']'
|
||||
else:
|
||||
inserts[end] = ']'
|
||||
else:
|
||||
if start in inserts:
|
||||
inserts[start] += ' ('
|
||||
else:
|
||||
inserts[start] = '('
|
||||
inserts[end] = ')'
|
||||
if end in inserts:
|
||||
inserts[end] += ')'
|
||||
else:
|
||||
inserts[end] = ')'
|
||||
for i in range(start + 1, end):
|
||||
inserts[i] = '|'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue