histogram/build/get_python_library.py
Hans Dembinski 41b49a0fc5 fix
2018-07-17 20:35:25 +02:00

18 lines
436 B
Python

from distutils import sysconfig
import os
import sys
pj = os.path.join
d = sysconfig.get_config_vars()
for required_key in ("LDLIBRARY", "LIBDEST", "LIBDIR", "LIBPL"):
if required_key not in d:
raise StandardError("some keys not found:\n" + str(d))
library = d["LDLIBRARY"]
for libpath in ('LIBDEST', 'LIBDIR', 'LIBPL'):
p = pj(d[libpath], library)
if os.path.exists(p):
sys.stdout.write(p)
break