Skip to content

Commit

Permalink
Use sysconfig.get_config_var("VERSION")
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed Aug 29, 2018
1 parent d2b5553 commit d7b14b0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions julia/find_libpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,15 @@ def libpython_candidates(suffix=SHLIB_SUFFIX):
dlprefix = "" if is_windows else "lib"
sysdata = dict(
v=sys.version_info,
abiflags=(sysconfig.get_config_var("ABIFLAGS") or
# VERSION is X.Y in Linux/macOS and XY in Windows:
VERSION=(sysconfig.get_config_var("VERSION") or
"{v.major}.{v.minor}".format(v=sys.version_info)),
ABIFLAGS=(sysconfig.get_config_var("ABIFLAGS") or
sysconfig.get_config_var("abiflags") or ""),
)
lib_basenames.extend(dlprefix + p + suffix for p in [
"python{v.major}.{v.minor}{abiflags}".format(**sysdata),
"python{v.major}.{v.minor}".format(**sysdata),
"python{VERSION}{ABIFLAGS}".format(**sysdata),
"python{VERSION}".format(**sysdata),
"python{v.major}".format(**sysdata),
"python",
])
Expand Down

0 comments on commit d7b14b0

Please sign in to comment.