mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +00:00
[3.13] bpo-44864: Do not translate user-provided strings in ArgumentParser.add_subparsers() (GH-27667) (#124506)
bpo-44864: Do not translate user-provided strings in ArgumentParser.add_subparsers() (GH-27667)
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:
parent
0a57fe3a7d
commit
6425443e1d
2 changed files with 3 additions and 2 deletions
|
|
@ -1834,8 +1834,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue