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)
Automerge-Triggered-By: GH:encukou
This commit is contained in:
parent
fe13f0b0f6
commit
17575f73ce
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