bpo-37785: Fix xgettext warning in argparse (GH-15161)
(cherry picked from commit 42671aea2d
)
Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
This commit is contained in:
parent
664d56a52e
commit
8750dfe09e
|
@ -1214,8 +1214,9 @@ class FileType(object):
|
|||
return open(string, self._mode, self._bufsize, self._encoding,
|
||||
self._errors)
|
||||
except OSError as e:
|
||||
message = _("can't open '%s': %s")
|
||||
raise ArgumentTypeError(message % (string, e))
|
||||
args = {'filename': string, 'error': e}
|
||||
message = _("can't open '%(filename)s': %(error)s")
|
||||
raise ArgumentTypeError(message % args)
|
||||
|
||||
def __repr__(self):
|
||||
args = self._mode, self._bufsize
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Fix xgettext warnings in :mod:`argparse`.
|
Loading…
Reference in New Issue