[FIX] base: import po file with comments only

Do not crash when importing a po file with only comments lines (e.g.
autogenerated files)
Fixes #4887
This commit is contained in:
Christophe Combelles 2015-01-24 21:43:36 +02:00 committed by Martin Trigaux
parent 856bc6f2b1
commit 737728a7a0
1 changed files with 2 additions and 0 deletions

View File

@ -329,6 +329,8 @@ class TinyPoFile(object):
elif line.startswith('#,') and (line[2:].strip() == 'fuzzy'):
fuzzy = True
line = self.lines.pop(0).strip()
if not self.lines:
raise StopIteration()
while not line:
# allow empty lines between comments and msgid
line = self.lines.pop(0).strip()