gh-99370: Prefer LIBDIR from sysconfig when locating libpython for test (GH-99523)

This commit is contained in:
Steve Dower 2022-11-16 21:41:13 +00:00 committed by GitHub
parent 51d10354f4
commit 7c57857340
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -594,7 +594,9 @@ class BasicTest(BaseTest):
# For python built with shared enabled. We need to set
# LD_LIBRARY_PATH so the non-installed python can find and link
# libpython.so
ld_library_path = os.path.abspath(os.path.dirname(sys.executable))
ld_library_path = sysconfig.get_config_var("LIBDIR")
if not ld_library_path or sysconfig.is_python_build():
ld_library_path = os.path.abspath(os.path.dirname(sys.executable))
if sys.platform == 'darwin':
ld_library_path_env = "DYLD_LIBRARY_PATH"
else: