[Python-checkins] gh-99370: Prefer LIBDIR from sysconfig when locating libpython for test (GH-99523)
zooba
webhook-mailer at python.org
Wed Nov 16 16:41:19 EST 2022
https://github.com/python/cpython/commit/7c57857340befcb90394bc347c904ca62049b684
commit: 7c57857340befcb90394bc347c904ca62049b684
branch: main
author: Steve Dower <steve.dower at python.org>
committer: zooba <steve.dower at microsoft.com>
date: 2022-11-16T21:41:13Z
summary:
gh-99370: Prefer LIBDIR from sysconfig when locating libpython for test (GH-99523)
files:
M Lib/test/test_venv.py
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index c685a6554cfc..4e18dfc23c40 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -594,7 +594,9 @@ def test_zippath_from_non_installed_posix(self):
# 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:
More information about the Python-checkins
mailing list