diff options
author | Anthony Sottile <asottile@umich.edu> | 2021-07-23 08:49:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-23 05:49:04 -0700 |
commit | 17575f73ce2cb9f3a4eb4cc416c690f9a4e7205c (patch) | |
tree | aae5b349852e301f25d191e5408b562e7028e953 /Lib/argparse.py | |
parent | fe13f0b0f696464dd6f283576668dbf57cb11399 (diff) | |
download | cpython-git-17575f73ce2cb9f3a4eb4cc416c690f9a4e7205c.tar.gz |
bpo-29298: Fix crash with required subparsers without dest (GH-3680)
Automerge-Triggered-By: GH:encukou
Diffstat (limited to 'Lib/argparse.py')
-rw-r--r-- | Lib/argparse.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py index 8a12dea766..e3a49e74fa 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -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 |