mirror of
https://github.com/boostorg/histogram.git
synced 2025-05-12 13:41:48 +00:00
21 lines
548 B
Python
21 lines
548 B
Python
from distutils import sysconfig
|
|
import os.path
|
|
import sys
|
|
import glob
|
|
pj = os.path.join
|
|
|
|
pyver = sysconfig.get_config_var('VERSION')
|
|
getvar = sysconfig.get_config_var
|
|
|
|
libname = "python" + pyver
|
|
|
|
for libvar in ('LIBDIR', 'LIBPL'):
|
|
for ext in ('so', 'dylib', 'dll'):
|
|
match = pj(getvar(libvar), "*" + libname + "*." + ext)
|
|
lib = glob.glob(match)
|
|
if lib:
|
|
if len(lib) > 1:
|
|
raise ValueError("too many matches:\n" + "\n".join(lib))
|
|
sys.stdout.write(lib[0])
|
|
raise SystemExit
|