diff options
author | Éric Araujo <merwok@netwok.org> | 2010-12-03 19:19:17 +0000 |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2010-12-03 19:19:17 +0000 |
commit | 1ab618e86f01b6906c93bde4c1bcb0ffcb1e5087 (patch) | |
tree | 70b2084f64aaf972292ef1393b8c3be2ec0491c5 | |
parent | b69e9fa4b0f6dc8ebf1cf52853e0476f5d049e55 (diff) | |
download | cpython-1ab618e86f01b6906c93bde4c1bcb0ffcb1e5087.tar.gz |
Fix incorrect use of gettext in argparse (#10497).
Steven, the maintainer of argparse, agreed to have this committed
without tests for now, since the fix is obvious. See the bug log.
-rw-r--r-- | Lib/argparse.py | 4 | ||||
-rw-r--r-- | Misc/NEWS | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/Lib/argparse.py b/Lib/argparse.py index 855ff5b93f..63713c6c42 100644 --- a/Lib/argparse.py +++ b/Lib/argparse.py @@ -1080,7 +1080,7 @@ class _SubParsersAction(Action): parser = self._name_parser_map[parser_name] except KeyError: tup = parser_name, ', '.join(self._name_parser_map) - msg = _('unknown parser %r (choices: %s)' % tup) + msg = _('unknown parser %r (choices: %s)') % tup raise ArgumentError(self, msg) # parse all the remaining options into the namespace @@ -1121,7 +1121,7 @@ class FileType(object): elif 'w' in self._mode: return _sys.stdout else: - msg = _('argument "-" with mode %r' % self._mode) + msg = _('argument "-" with mode %r') % self._mode raise ValueError(msg) # all other arguments are used as file names @@ -35,6 +35,8 @@ Core and Builtins Library ------- +- Issue #10497: Fix incorrect use of gettext in argparse. + - Issue #10478: Reentrant calls inside buffered IO objects (for example by way of a signal handler) now raise a RuntimeError instead of freezing the current process. |