Fix another bug in top detection. Hopefully that's the last.

This commit is contained in:
Kovid Goyal 2007-05-22 01:40:18 +00:00
parent 7a21b56f22
commit 84e6a65425
2 changed files with 6 additions and 5 deletions

View File

@ -33,7 +33,7 @@ You may have to adjust the GROUP and the location of the rules file to
suit your distribution.
"""
__version__ = "0.3.35"
__version__ = "0.3.36"
__docformat__ = "epytext"
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"

View File

@ -450,11 +450,11 @@ class HTMLConverter(object):
if not self.top.parent:
if not previous:
try:
previous = self.book.pages()[0]
except IndexError:
self.top = get_valid_block(self.current_page)
if not self.top or not self.top.parent:
raise ConversionError, self.file_name + ' does not seem to have any content'
return
found = False
for page in self.book.pages():
if page == previous:
@ -465,6 +465,7 @@ class HTMLConverter(object):
if not self.top:
continue
break
if not self.top or not self.top.parent:
raise ConversionError, 'Could not parse ' + self.file_name