File: find_python2

package info (click to toggle)
julia 1.0.3%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 49,452 kB
  • sloc: lisp: 236,453; ansic: 55,579; cpp: 25,603; makefile: 1,685; pascal: 1,130; sh: 956; asm: 86; xml: 76
file content (16 lines) | stat: -rwxr-xr-x 320 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
#
# LLVM requires 2.7 <= python2 < 3
#

valid_python() {
    $1 -c 'import sys; sys.exit(not (sys.version_info >= (2,7) and sys.version_info < (3,0)))' 2> /dev/null
}

for python in python python2 python2.7 python27; do
    if valid_python $python; then
        echo `which $python`
        break
    fi
done