Handle build failing when running under pyenv

This commit is contained in:
Kovid Goyal 2017-01-08 08:48:31 +05:30
parent fcb072bbd9
commit b3fbb938b3

View File

@ -79,7 +79,11 @@ def init_env(debug=False, asan=False):
cflags.append('-I' + sysconfig.get_config_var('CONFINCLUDEPY'))
if isosx:
fd = sysconfig.get_config_var('LIBDIR')
fd = fd[:fd.index('/Python.framework')]
try:
fd = fd[:fd.index('/Python.framework')]
except ValueError:
fd = sysconfig.get_config_var('LIBDEST')
fd = fd[:fd.index('/Python.framework')]
pylib = ['-F', fd, '-framework', 'Python.framework']
else:
lib = sysconfig.get_config_var('LDLIBRARY')