]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Allow translating argument error messages (#17169)
authorDjMorgul <jmfo1982@gmail.com>
Thu, 5 May 2022 05:32:49 +0000 (07:32 +0200)
committerGitHub <noreply@github.com>
Thu, 5 May 2022 05:32:49 +0000 (00:32 -0500)
Lib/argparse.py

index 8d1a00ad2207e58575c2fcfec731a17e8aff2bce..1c5520c4b41bd19623a10553b368dc0d13df581e 100644 (file)
@@ -766,7 +766,7 @@ class ArgumentError(Exception):
         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)