1#!/usr/bin/env python 2 3import sys, os 4if not type(sys.version_info) is tuple and sys.version_info.major > 2: 5 if os.path.basename(sys.executable) == 'python2': 6 # Exit to prevent an infinite loop in case the environment is corrupted such 7 # that "python2" in PATH is actually a Python 3 interpreter. 8 print('Executable not a valid Python 2 interpreter: ' + sys.executable) 9 sys.exit(1) 10 print('Configure does not support Python 3 yet, attempting to run as') 11 print(' python2 ' + ' '.join(["'" + a + "'" for a in sys.argv])) 12 os.execlp('python2', 'python2', *sys.argv) 13 14execfile(os.path.join(os.path.dirname(__file__), 'config', 'configure.py')) 15