Merge pull request #489 from Alexander-N/attribute-error

build.rs: Handle `python` being Python 2
This commit is contained in:
Yuji Kanagawa 2019-05-16 10:54:47 +09:00 committed by GitHub
commit 89ba9f52ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -503,7 +503,10 @@ if PYPY:
else:
print(sysconfig.get_config_var('Py_ENABLE_SHARED'))
print(sysconfig.get_config_var('LDVERSION') or sysconfig.get_config_var('py_version_short'))
print(sys.base_prefix)
try:
print(sys.base_prefix)
except AttributeError:
print(sys.exec_prefix)
print(platform.python_implementation())
"#;
let out = run_python_script(interpreter, script)?;