aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2017-01-27 18:20:18 +0200
committerFilipp Lepalaan <filipp@mac.com>2017-01-27 18:20:18 +0200
commite630c66b56c91652ed66c2f6f92f38047c26af5f (patch)
tree560d876e8068468d9503063a047b7d1d6fca3b73
parenta90cd1f76fef52794d6815c17889f2578e7f86ce (diff)
downloaddjango-wkhtmltopdf-e630c66b56c91652ed66c2f6f92f38047c26af5f.tar.gz
django-wkhtmltopdf-e630c66b56c91652ed66c2f6f92f38047c26af5f.tar.bz2
django-wkhtmltopdf-e630c66b56c91652ed66c2f6f92f38047c26af5f.zip
Cleanup
-rw-r--r--wkhtmltopdf/process.py6
1 files 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")