mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-29298: Fix crash with required subparsers without dest (GH-3680) (GH-27304)
(cherry picked from commit 17575f73ce
)
Co-authored-by: Anthony Sottile <asottile@umich.edu>
This commit is contained in:
parent
0f55d21212
commit
097801844c
3 changed files with 28 additions and 0 deletions
|
@ -727,6 +727,8 @@ def _get_action_name(argument):
|
|||
return argument.metavar
|
||||
elif argument.dest not in (None, SUPPRESS):
|
||||
return argument.dest
|
||||
elif argument.choices:
|
||||
return '{' + ','.join(argument.choices) + '}'
|
||||
else:
|
||||
return None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue