Handle broken swig version that prints version info on stderr.

--HG--
extra : convert_revision : 83021779c40972fa56893d21713c6115cd481bc4
This commit is contained in:
Steve Reinhardt 2007-07-14 21:35:26 -04:00
parent e5ecfa2745
commit 658eeee507

View file

@ -259,7 +259,8 @@ if not env.has_key('SWIG'):
# Check for appropriate SWIG version
swig_version = os.popen('swig -version').read().split()
# First 3 words should be "SWIG Version x.y.z"
if swig_version[0] != 'SWIG' or swig_version[1] != 'Version':
if len(swig_version) < 3 or \
swig_version[0] != 'SWIG' or swig_version[1] != 'Version':
print 'Error determining SWIG version.'
Exit(1)