Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d9ecd42

Browse files
committed
changed dependency check for ghostscript, which was failing to identify svn
versions svn path=/trunk/matplotlib/; revision=3968
1 parent 6516322 commit d9ecd42

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

lib/matplotlib/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"""
5656
from __future__ import generators
5757

58-
NEWCONFIG = False
58+
NEWCONFIG = True
5959

6060
__version__ = '0.90.1'
6161
__revision__ = '$Revision$'
@@ -243,7 +243,7 @@ def checkdep_ghostscript():
243243
command = 'gs -v'
244244
stdin, stdout = os.popen4(command)
245245
line = stdout.readlines()[0]
246-
v = line.split()[2]
246+
v = line.split()[-2]
247247
vtest = '.'.join(v.split('.')[:2]) # deal with version numbers like '7.07.1'
248248
float(vtest)
249249
return vtest

lib/matplotlib/config/checkdep.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import os, re, sys
1+
import os
2+
import re
3+
import sys
4+
import warnings
25
import distutils.version as version
36

47
def dvipng():
@@ -19,7 +22,7 @@ def ghostscript():
1922
command = 'gs -v'
2023
stdin, stdout = os.popen4(command)
2124
line = stdout.readlines()[0]
22-
v = line.split()[2]
25+
v = line.split()[-2]
2326
vtest = '.'.join(v.split('.')[:2]) # deal with version numbers like '7.07.1'
2427
float(vtest)
2528
return vtest
@@ -130,4 +133,4 @@ def usetex(s):
130133
'unless ghostscript-%s or later is '
131134
'installed on your system') % gs_req)
132135

133-
return flag
136+
return flag

0 commit comments

Comments
 (0)