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:
Miss Islington (bot) 2019-09-13 02:45:27 -07:00 committed by GitHub
parent 664d56a52e
commit 8750dfe09e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -0,0 +1 @@
Fix xgettext warnings in :mod:`argparse`.