Localization fails for MaxArgumentError

When MaxArgumentError si raised, the string localized by ngettext
is not printed properly.

https://fedorahosted.org/freeipa/ticket/1148
This commit is contained in:
Martin Kosek 2011-05-31 09:39:10 +02:00 committed by Rob Crittenden
parent d7c60205a6
commit 31bf405fe3

View File

@ -263,7 +263,10 @@ class PublicError(StandardError):
self.format = format
self.forwarded = False
self.msg = self.format % kw
if isinstance(self.format, basestring):
self.strerror = ugettext(self.format) % kw
else:
self.strerror = self.format % kw
else:
if type(message) is not unicode:
raise TypeError(