From 9bea79b1bb6fdd00e154ea063e47e641a03abdb1 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 4 Sep 2019 22:43:42 +0530 Subject: [PATCH] ... --- src/calibre/ebooks/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/__init__.py b/src/calibre/ebooks/__init__.py index dd6207b6d3..66d77c0e8e 100644 --- a/src/calibre/ebooks/__init__.py +++ b/src/calibre/ebooks/__init__.py @@ -118,12 +118,13 @@ def render_html_svg_workaround(path_to_html, log, width=590, height=750): def render_html_data(path_to_html, width, height): from calibre.ptempfile import TemporaryDirectory from calibre.utils.ipc.simple_worker import fork_job, WorkerError + result = {} def report_error(text=''): prints('Failed to render', path_to_html, 'with errors:', file=sys.stderr) if text: prints(text, file=sys.stderr) - if result['stdout_stderr']: + if result and result['stdout_stderr']: with open(result['stdout_stderr'], 'rb') as f: prints(f.read(), file=sys.stderr)