File: find_python2

package info (click to toggle)
julia 0.4.7-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 22,128 kB
  • ctags: 15,440
  • sloc: lisp: 146,606; ansic: 96,638; sh: 12,615; cpp: 11,846; makefile: 3,431; python: 1,005; pascal: 856; xml: 585; f90: 415; java: 343; asm: 86; perl: 77
file content (16 lines) | stat: -rwxr-xr-x 358 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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