Message408409
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) |
|
Date |
User |
Action |
Args |
2021-12-12 20:01:54 | Laszlo.Attila.Toth | set | recipients:
+ Laszlo.Attila.Toth, iritkatriel |
2021-12-12 20:01:54 | Laszlo.Attila.Toth | set | messageid: <1639339314.32.0.964368879522.issue46057@roundup.psfhosted.org> |
2021-12-12 20:01:54 | Laszlo.Attila.Toth | link | issue46057 messages |
2021-12-12 20:01:54 | Laszlo.Attila.Toth | create | |
|