Skip to content

Commit 55cc357

Browse files
committed
bpo-42547: fix add_argument(metavar=<tuple>, nargs='+') for positional arguments
1 parent dedc2cd commit 55cc357

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/argparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ def _format_action(self, action):
547547
def _format_action_invocation(self, action):
548548
if not action.option_strings:
549549
default = self._get_default_metavar_for_positional(action)
550-
metavar, = self._metavar_formatter(action, default)(1)
550+
metavar = self._metavar_formatter(action, default)(1)[0]
551551
return metavar
552552

553553
else:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
argparse: fixed `add_argument(metavar=<tuple>, nargs='+')` for positional arguments

0 commit comments

Comments
 (0)