Skip to content

Commit

Permalink
tools: suggest python2 command in configure
Browse files Browse the repository at this point in the history
Try and find a suitable python2 binary and suggest it to the user in
case they start the configure script with a incompatible version.

PR-URL: #11375
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
  • Loading branch information
silverwind authored and jasnell committed Mar 7, 2017
1 parent 1ace4e2 commit c74fa1b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@

import sys
if sys.version_info[0] != 2 or sys.version_info[1] not in (6, 7):
sys.stdout.write("Please use either Python 2.6 or 2.7\n")
sys.stderr.write('Please use either Python 2.6 or 2.7')

from distutils.spawn import find_executable as which
python2 = which('python2') or which('python2.6') or which('python2.7')

if python2:
sys.stderr.write(':\n\n')
sys.stderr.write(' ' + python2 + ' ' + ' '.join(sys.argv))

sys.stderr.write('\n')
sys.exit(1)

import errno
Expand Down

0 comments on commit c74fa1b

Please sign in to comment.