diff options
-rw-r--r-- | wkhtmltopdf/utils.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/wkhtmltopdf/utils.py b/wkhtmltopdf/utils.py index e841380..9c338bf 100644 --- a/wkhtmltopdf/utils.py +++ b/wkhtmltopdf/utils.py @@ -93,8 +93,13 @@ def wkhtmltopdf(pages, output=None, **kwargs): list(pages), [output])) ck_kwargs = {'env': env} - if hasattr(sys.stderr, 'fileno'): + try: + i = sys.stderr.fileno() ck_kwargs['stderr'] = sys.stderr + except AttributeError: + # can't call fileno() on mod_wsgi stderr object + pass + return check_output(ck_args, **ck_kwargs) |