]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Fixed a small bug in the python format string checker that caused the wrong exception...
authorArmin Ronacher <armin.ronacher@active-4.com>
Tue, 17 Jun 2008 19:59:02 +0000 (19:59 +0000)
committerArmin Ronacher <armin.ronacher@active-4.com>
Tue, 17 Jun 2008 19:59:02 +0000 (19:59 +0000)
babel/messages/checkers.py

index 314853c4ec2c26890fb9c6172545f944977fe50a..fdee95dc0bd5c65874fcd32e047683ac2dd72de4 100644 (file)
@@ -44,6 +44,7 @@ def num_plurals(catalog, message):
 
 
 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 @@ def _validate_format(format, alternative):
                 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))