]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
More robust handling of argument indices in message extraction.
authorChristopher Lenz <cmlenz@gmail.com>
Fri, 13 Jul 2007 16:33:28 +0000 (16:33 +0000)
committerChristopher Lenz <cmlenz@gmail.com>
Fri, 13 Jul 2007 16:33:28 +0000 (16:33 +0000)
babel/messages/extract.py

index 39810923b957ce9a35c3ba894a13d7dfb26de352..da0063c260e744607468d6d163a86fe3d1ab74d5 100644 (file)
@@ -220,7 +220,7 @@ def extract(method, fileobj, keywords=DEFAULT_KEYWORDS, comment_tags=(),
         for lineno, funcname, messages, comments in results:
             if isinstance(messages, (list, tuple)):
                 msgs = []
-                for index in keywords[funcname]:
+                for index in keywords[funcname] or (1,):
                     msgs.append(messages[index - 1])
                 messages = tuple(msgs)
                 if len(messages) == 1: