mirror of https://github.com/python/cpython
bpo-44864: Do not translate user-provided strings in ArgumentParser.add_subparsers() (GH-27667)
Call _() on literal strings only.
This commit is contained in:
parent
af8403a58d
commit
d3c76dff44
|
@ -1804,8 +1804,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
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Do not translate user-provided strings in :class:`argparse.ArgumentParser`.
|
Loading…
Reference in New Issue