summaryrefslogtreecommitdiff
path: root/sphinx
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-01-19 11:42:44 +0100
committerGeorg Brandl <georg@python.org>2014-01-19 11:42:44 +0100
commit2ad1a687bffbc9075ea4df56e638475e748d9af1 (patch)
treeeac201b5396945a81f7dae0094a1c45147b168e4 /sphinx
parent029d8bec8503b5f1da91d86ca13a174d5753a4b9 (diff)
downloadsphinx-2ad1a687bffbc9075ea4df56e638475e748d9af1.tar.gz
Closes #1329: Fix traceback with empty translation msgstr in .po files.
Diffstat (limited to 'sphinx')
-rw-r--r--sphinx/transforms.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/sphinx/transforms.py b/sphinx/transforms.py
index 338d4739..14e2c97f 100644
--- a/sphinx/transforms.py
+++ b/sphinx/transforms.py
@@ -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