# HG changeset patch # User aronacher # Date 1213732742 0 # Node ID 0791b3bf42cc00ce772061d5d9736ac5249ef1cd # Parent 8860097a9765cb28edd9908acbc44ad6921d2ee8 Fixed a small bug in the python format string checker that caused the wrong exception to be thrown. diff --git a/babel/messages/checkers.py b/babel/messages/checkers.py --- a/babel/messages/checkers.py +++ b/babel/messages/checkers.py @@ -44,6 +44,7 @@ def python_format(catalog, message): + """Verify the format string placeholders in the translation.""" if 'python-format' not in message.flags: return msgids = message.id @@ -114,8 +115,8 @@ positional = name is None else: if (name is None) != positional: - raise ValueError('format string mixes positional ' - 'and named placeholders') + raise TranslationError('format string mixes positional ' + 'and named placeholders') return bool(positional) a, b = map(_parse, (format, alternative))