8000 /matplotlib/__init__.py: catch OSError when calling subprocess. · smunix/matplotlib@6fbd556 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6fbd556

Browse f 8000 iles
committed
/matplotlib/__init__.py: catch OSError when calling subprocess.
An OSError can occur when the user does not have the command in the path. Fixes an error reported by Nils Wagner. svn path=/trunk/matplotlib/; revision=6563
1 parent 218d726 commit 6fbd556

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def checkdep_dvipng():
262262
line = s.stdout.readlines()[1]
263263
v = line.split()[-1]
264264
return v
265-
except (IndexError, ValueError):
265+
except (IndexError, ValueError, OSError):
266266
return None
267267

268268
def checkdep_ghostscript():
@@ -275,7 +275,7 @@ def checkdep_ghostscript():
275275
stderr=subprocess.PIPE)
276276
v = s.stdout.read()[:-1]
277277
return v
278-
except (IndexError, ValueError):
278+
except (IndexError, ValueError, OSError):
279279
return None
280280

281281
def checkdep_tex():
@@ -287,7 +287,7 @@ def checkdep_tex():
287287
match = re.search(pattern, line)
288288
v = match.group(0)
289289
return v
290-
except (IndexError, ValueError, AttributeError):
290+
except (IndexError, ValueError, AttributeError, OSError):
291291
return None
292292

293293
def checkdep_pdftops():
@@ -298,7 +298,7 @@ def checkdep_pdftops():
298298
if 'version' in line:
299299
v = line.split()[-1]
300300
return v
301-
except (IndexError, ValueError, UnboundLocalError):
301+
except (IndexError, ValueError, UnboundLocalError, OSError):
302302
return None
303303

304304
def compare_versions(a, b):

0 commit comments

Comments
 (0)
0