Skip to content

Commit

Permalink
Merge pull request #3277 from tacaswell/gs_check
Browse files Browse the repository at this point in the history
MNT : better error handling on determining gs version
  • Loading branch information
WeatherGod committed Jul 24, 2014
2 parents 69d5ef4 + ae62a35 commit 5680965
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/matplotlib/backends/backend_ps.py
Expand Up @@ -56,6 +56,7 @@ def _fn_name(): return sys._getframe(1).f_code.co_name

debugPS = 0


class PsBackendHelper(object):

def __init__(self):
Expand All @@ -78,7 +79,6 @@ def gs_exe(self):
self._cached["gs_exe"] = gs_exe
return gs_exe


@property
def gs_version(self):
"""
Expand All @@ -97,8 +97,11 @@ def gs_version(self):
ver = pipe.decode('ascii')
else:
ver = pipe
gs_version = tuple(map(int, ver.strip().split(".")))

try:
gs_version = tuple(map(int, ver.strip().split(".")))
except ValueError:
# if something went wrong parsing return null version number
gs_version = (0, 0)
self._cached["gs_version"] = gs_version
return gs_version

Expand Down

0 comments on commit 5680965

Please sign in to comment.