Skip to content

Commit 0014ce7

Browse files
gh-99370: Prefer LIBDIR from sysconfig when locating libpython for test (GH-99523)
(cherry picked from commit 7c57857) Co-authored-by: Steve Dower <steve.dower@python.org>
1 parent a06fb51 commit 0014ce7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Lib/test/test_venv.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,9 @@ def test_zippath_from_non_installed_posix(self):
594594
# For python built with shared enabled. We need to set
595595
# LD_LIBRARY_PATH so the non-installed python can find and link
596596
# libpython.so
597-
ld_library_path = os.path.abspath(os.path.dirname(sys.executable))
597+
ld_library_path = sysconfig.get_config_var("LIBDIR")
598+
if not ld_library_path or sysconfig.is_python_build():
599+
ld_library_path = os.path.abspath(os.path.dirname(sys.executable))
598600
if sys.platform == 'darwin':
599601
ld_library_path_env = "DYLD_LIBRARY_PATH"
600602
else:

0 commit comments

Comments
 (0)