Possibly more portable Python version extraction.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5431 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2003-11-28 18:23:14 +00:00
commit cb97e287cd

View file

@ -565,7 +565,7 @@ if test -n "$PYTHON"; then
# Need to do this hack since autoconf replaces __file__ with the name of the configure file
filehack="file__"
PYVERSION=`($PYTHON -c "import string,operator; print operator.getitem(string.split(string.__$filehack,'/'),-2)")`
PYVERSION=`($PYTHON -c "import string,operator,os.path; print operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1)")`
AC_MSG_RESULT($PYVERSION)
# Set the include directory