Closes #1329: Fix traceback with empty translation msgstr in .po files.

This commit is contained in:
Georg Brandl 2014-01-19 11:42:44 +01:00
parent 97b3ac0187
commit 1762a22bd8
2 changed files with 10 additions and 2 deletions

View File

@ -109,6 +109,8 @@ Bugs fixed
* #1316: Remove hard-coded ``font-face`` resources from epub theme.
* #1329: Fix traceback with empty translation msgstr in .po files.
Documentation
-------------

View File

@ -196,7 +196,10 @@ class Locale(Transform):
patch = new_document(source, settings)
CustomLocaleReporter(node.source, node.line).set_reporter(patch)
parser.parse(msgstr, patch)
patch = patch[0]
try:
patch = patch[0]
except IndexError: # empty node
pass
# XXX doctest and other block markup
if not isinstance(patch, nodes.paragraph):
continue # skip for now
@ -299,7 +302,10 @@ class Locale(Transform):
patch = new_document(source, settings)
CustomLocaleReporter(node.source, node.line).set_reporter(patch)
parser.parse(msgstr, patch)
patch = patch[0]
try:
patch = patch[0]
except IndexError: # empty node
pass
# XXX doctest and other block markup
if not isinstance(patch, nodes.paragraph):
continue # skip for now