CHM Input: Handle CHM files that dont specify a topics file. Fixes #9253 (Failed to convert .chm file)

This commit is contained in:
Kovid Goyal 2011-03-03 12:39:29 -07:00
parent 5ade2ccc74
commit 448c405ef2

View File

@ -54,6 +54,10 @@ class CHMReader(CHMFile):
self._extracted = False
# location of '.hhc' file, which is the CHM TOC.
if self.topics is None:
self.root, ext = os.path.splitext(self.home.lstrip('/'))
self.hhc_path = self.root + ".hhc"
else:
self.root, ext = os.path.splitext(self.topics.lstrip('/'))
self.hhc_path = self.root + ".hhc"