László Attila Tóth <laszlo.attila.t...@gmail.com> added the comment:
The fix is something like this for _ArgumentGroup, but as the container may not be an _ArgumentGroup, it breaks the tests. --- Lib/argparse.py +++ Lib/argparse.py @@ -1635,9 +1640,13 @@ def __init__(self, container, title=None, description=None, **kwargs): self._has_negative_number_optionals = \ container._has_negative_number_optionals self._mutually_exclusive_groups = container._mutually_exclusive_groups + self._container = container def _add_action(self, action): - action = super(_ArgumentGroup, self)._add_action(action) + if self.title: + action = super(_ArgumentGroup, self)._add_action(action) + else: + action = self._container._add_action(action) self._group_actions.append(action) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46057> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com