diff --git a/Lib/argparse.py b/Lib/argparse.py index 2fb1da59f942cf..525c8720005479 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -547,7 +547,7 @@ def _format_action(self, action): def _format_action_invocation(self, action): if not action.option_strings: default = self._get_default_metavar_for_positional(action) - metavar, = self._metavar_formatter(action, default)(1) + metavar = self._metavar_formatter(action, default)(1)[0] return metavar else: diff --git a/Misc/NEWS.d/next/Library/2020-12-03-00-40-12.bpo-42547.O2BJhp.rst b/Misc/NEWS.d/next/Library/2020-12-03-00-40-12.bpo-42547.O2BJhp.rst new file mode 100644 index 00000000000000..1266d0d670f4ea --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-12-03-00-40-12.bpo-42547.O2BJhp.rst @@ -0,0 +1 @@ +argparse: fixed `add_argument(metavar=, nargs='+')` for positional arguments