[3.12] bpo-44864: Do not translate user-provided strings in ArgumentParser.add_subparsers() (GH-27667) (GH-124505)

Call _() on literal strings only.
(cherry picked from commit d3c76dff44)

Co-authored-by: Jérémie Detrey <jdetrey@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2024-09-25 12:28:27 +02:00 committed by GitHub
parent cf06f5905f
commit 306368c9c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -1847,8 +1847,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
kwargs.setdefault('parser_class', type(self))
if 'title' in kwargs or 'description' in kwargs:
title = _(kwargs.pop('title', 'subcommands'))
description = _(kwargs.pop('description', None))
title = kwargs.pop('title', _('subcommands'))
description = kwargs.pop('description', None)
self._subparsers = self.add_argument_group(title, description)
else:
self._subparsers = self._positionals