From 1e41f2dad90b68322ec27c850aad9b188670bf63 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Thu, 21 Nov 2013 14:32:18 -0800 Subject: [PATCH] Skip ghostscript test when it's not executable --- Tests/test_file_eps.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Tests/test_file_eps.py b/Tests/test_file_eps.py index 75570f944..f9e1702ef 100644 --- a/Tests/test_file_eps.py +++ b/Tests/test_file_eps.py @@ -1,6 +1,20 @@ from tester import * -from PIL import Image +from PIL import Image, EpsImagePlugin +import sys + +if EpsImagePlugin.gs_windows_binary == False: + # already checked. Not there. + skip() + +if not sys.platform.startswith('win'): + import subprocess + try: + gs = subprocess.Popen(['gs','--version'], stdout=subprocess.PIPE) + gs.stdout.read() + except OSError: + # no ghostscript + skip() #Our two EPS test files (they are identical except for their bounding boxes) file1 = "Tests/images/zero_bb.eps"