def _get_python_version(self):
venv_python = self.get_python_program()
# FIXME: use a get_output() function
code = 'import sys; print(sys.hexversion)'
exitcode, stdout = self.get_output_nocheck(venv_python, '-c', code)
if exitcode:
print("ERROR: failed to get the Python version")
sys.exit(exitcode)
hexversion = int(stdout.rstrip())
print("Python hexversion: %x" % hexversion)
# On Python: 3.5a0 <= version < 3.5.0 (final), install pip 7.1.2,
# the last version working on Python 3.5a0:
# https://sourceforge.net/p/pyparsing/bugs/100/
self._force_old_pip = (0x30500a0 <= hexversion < 0x30500f0)
评论列表
文章目录