Skip to content

Commit 2fb097d

Browse files
committed
update version and get_version()
1 parent 7faa75e commit 2fb097d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pydf/wkhtmltopdf.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import subprocess
33
from tempfile import NamedTemporaryFile
44

5-
__version__ = '0.1'
5+
__version__ = '0.2'
66

77

88
def execute_wk(*args):
@@ -119,7 +119,12 @@ def get_version():
119119
:return: version string
120120
"""
121121
v = 'pydf version: %s\n' % __version__
122-
v += 'wkhtmltopdf version: %s' % execute_wk('-V')[0]
122+
try:
123+
wk_version = execute_wk('-V')[0]
124+
except Exception, e:
125+
# we catch all errors here to make sure we get a version no matter what
126+
wk_version = 'Error: %s' % str(e)
127+
v += 'wkhtmltopdf version: %s' % wk_version
123128
return v
124129

125130

0 commit comments

Comments
 (0)