diff --git a/refine b/refine index 4ee569672..56e39d8dc 100755 --- a/refine +++ b/refine @@ -124,9 +124,16 @@ check_python() { if [ -z "$PYTHON" ] ; then error "This action requires you to have 'python' installed and present in your PATH. You can download it for free at http://www.python.org/" fi - PYTHON_VERSION="`python --version 2>&1 | cut -f 2 -d ' ' | cut -f 1,2 -d .`" - if [ "$PYTHON_VERSION" != "2.5" ] && [ "$PYTHON_VERSION" != "2.6" && [ "$PYTHON_VERSION" != "2.7" ]] ; then - error "This action requires python version 2.5.x, 2.6.x or 2.7.x. You can download it for free at http://www.python.org/" + PYTHON_VERSION="`$PYTHON --version 2>&1 | cut -f 2 -d ' ' | cut -f 1,2 -d .`" + if [ "$PYTHON_VERSION" = "2.7" ] ; then + PYTHON="`which python2.6 2> /dev/null`" + if [ -z "$PYTHON" ] ; then + error "Default Python is v2.7 which not supported by Windmill. No python2.6 alternative found on path." + fi + PYTHON_VERSION="`$PYTHON --version 2>&1 | cut -f 2 -d ' ' | cut -f 1,2 -d .`" + fi + if [ "$PYTHON_VERSION" != "2.5" ] && [ "$PYTHON_VERSION" != "2.6" ]] ; then + error "This action requires python version 2.5.x, 2.6.x. You can download it for free at http://www.python.org/" fi }