From e630c66b56c91652ed66c2f6f92f38047c26af5f Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Fri, 27 Jan 2017 18:20:18 +0200 Subject: Cleanup --- wkhtmltopdf/process.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/wkhtmltopdf/process.py b/wkhtmltopdf/process.py index f2417fb..d12fa4e 100644 --- a/wkhtmltopdf/process.py +++ b/wkhtmltopdf/process.py @@ -63,15 +63,13 @@ def check_output(*popenargs, **kwargs): else: ignore_404 = False - if not kwargs.get('stderr'): - kwargs['stderr'] = PIPE - + kwargs.setdefault('stderr', PIPE) process = Popen(stdout=PIPE, *popenargs, **kwargs) output, error_message = process.communicate() retcode = process.poll() if retcode: - if ignore_404: + if error_message and ignore_404: if 'ContentNotFoundError' in error_message: return output cmd = kwargs.get("args") -- cgit v1.2.3