[Python-checkins] Allow translating argument error messages (#17169)
rhettinger
webhook-mailer at python.org
Thu May 5 01:33:14 EDT 2022
https://github.com/python/cpython/commit/b885b8f4be9c74ef1ce7923dbf055c31e7f47735
commit: b885b8f4be9c74ef1ce7923dbf055c31e7f47735
branch: main
author: DjMorgul <jmfo1982 at gmail.com>
committer: rhettinger <rhettinger at users.noreply.github.com>
date: 2022-05-05T00:32:49-05:00
summary:
Allow translating argument error messages (#17169)
files:
M Lib/argparse.py
diff --git a/Lib/argparse.py b/Lib/argparse.py
index 8d1a00ad2207e..1c5520c4b41bd 100644
--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -766,7 +766,7 @@ def __str__(self):
if self.argument_name is None:
format = '%(message)s'
else:
- format = 'argument %(argument_name)s: %(message)s'
+ format = _('argument %(argument_name)s: %(message)s')
return format % dict(message=self.message,
argument_name=self.argument_name)
More information about the Python-checkins
mailing list