8000 bpo-44864: Do not translate user-provided strings in ArgumentParser.a… · python/cpython@d3c76df · GitHub
[go: up one dir, main page]

Skip to content

Commit d3c76df

Browse files
authored
bpo-44864: Do not translate user-provided strings in ArgumentParser.add_subparsers() (GH-27667)
Call _() on literal strings only.
1 parent af8403a commit d3c76df

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Lib/argparse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,8 +1804,8 @@ def add_subparsers(self, **kwargs):
18041804
kwargs.setdefault('parser_class', type(self))
18051805

18061806
if 'title' in kwargs or 'description' in kwargs:
1807-
title = _(kwargs.pop('title', 'subcommands'))
1808-
description = _(kwargs.pop('description', None))
1807+
title = kwargs.pop('title', _('subcommands'))
1808+
description = kwargs.pop('description', None)
18091809
self._subparsers = self.add_argument_group(title, description)
18101810
else:
18111811
self._subparsers = self._positionals
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Do not translate user-provided strings in :class:`argparse.ArgumentParser`.

0 commit comments

Comments
 (0)
0