Skip to content

Commit

Permalink
bpo-37785: Fix xgettext warning in argparse (GH-15161)
Browse files Browse the repository at this point in the history
(cherry picked from commit 42671ae)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
  • Loading branch information
miss-islington and kulikjak committed Sep 13, 2019
1 parent 6e0c066 commit b50eff6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Lib/argparse.py
Expand Up @@ -1207,8 +1207,9 @@ def __call__(self, string):
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
Expand Down
@@ -0,0 +1 @@
Fix xgettext warnings in :mod:`argparse`.

0 comments on commit b50eff6

Please sign in to comment.