find_python2
#!/bin/sh
#
# LLVM requires 2.5 <= python2 < 3
#
valid_python() {
$1 -c 'import sys; sys.exit(not (sys.version_info >= (2,5) and sys.version_info < (3,0)))' 2> /dev/null
}
for python in python python2 python2.7 python27 python2.6 python26 python2.5 python25; do
if valid_python $python; then
echo `which $python`
break
fi
done