Don't die if writing to html2lrf-verbose fails.

This commit is contained in:
Kovid Goyal 2008-04-08 14:31:16 +05:30
parent f87dbae162
commit b4c8cd9264

View File

@ -336,10 +336,13 @@ class HTMLConverter(object):
tdir = tempfile.gettempdir() tdir = tempfile.gettempdir()
if not os.path.exists(tdir): if not os.path.exists(tdir):
os.makedirs(tdir) os.makedirs(tdir)
try:
dump = open(os.path.join(tdir, 'html2lrf-verbose.html'), 'wb') dump = open(os.path.join(tdir, 'html2lrf-verbose.html'), 'wb')
dump.write(unicode(soup).encode('utf-8')) dump.write(unicode(soup).encode('utf-8'))
self.logger.info(_('Written preprocessed HTML to ')+dump.name) self.logger.info(_('Written preprocessed HTML to ')+dump.name)
dump.close() dump.close()
except:
pass
return soup return soup