Commit fae18fd5 by Calen Pennington Committed by GitHub

Merge pull request #13271 from cpennington/dont-translate-passthrough

Don't use optparse's bad translation strings in passthrough_opts
parents ea0f08d6 abe6ef45
......@@ -13,15 +13,6 @@ import paver.tasks
from mock import patch
try:
from gettext import gettext
except ImportError:
def gettext(message):
"""Dummy gettext"""
return message
_ = gettext
class PassthroughOptionParser(OptionParser):
"""
An :class:`optparse.OptionParser` which captures any unknown options into
......@@ -66,9 +57,9 @@ class PassthroughOptionParser(OptionParser):
if len(rargs) < nargs:
if nargs == 1:
self.error(_("%s option requires an argument") % opt)
self.error("%s option requires an argument" % opt)
else:
self.error(_("%s option requires %d arguments")
self.error("%s option requires %d arguments"
% (opt, nargs))
elif nargs == 1:
value = rargs.pop(0)
......@@ -77,7 +68,7 @@ class PassthroughOptionParser(OptionParser):
del rargs[0:nargs]
elif had_explicit_value:
self.error(_("%s option does not take a value") % opt)
self.error("%s option does not take a value" % opt)
else:
value = None
......@@ -111,9 +102,9 @@ class PassthroughOptionParser(OptionParser):
nargs = option.nargs
if len(rargs) < nargs:
if nargs == 1:
self.error(_("%s option requires an argument") % opt)
self.error("%s option requires an argument" % opt)
else:
self.error(_("%s option requires %d arguments")
self.error("%s option requires %d arguments"
% (opt, nargs))
elif nargs == 1:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment