diff options
author | Steve Dower <steve.dower@python.org> | 2022-11-16 21:41:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-16 21:41:13 (GMT) |
commit | 7c57857340befcb90394bc347c904ca62049b684 (patch) | |
tree | bd3d3803d9ee95c646a1ebda1818e838bc2790da | |
parent | 51d10354f43c708ebbb7d13c14bf0ea52b28489e (diff) | |
download | cpython-7c57857340befcb90394bc347c904ca62049b684.zip cpython-7c57857340befcb90394bc347c904ca62049b684.tar.gz cpython-7c57857340befcb90394bc347c904ca62049b684.tar.bz2 |
gh-99370: Prefer LIBDIR from sysconfig when locating libpython for test (GH-99523)
-rw-r--r-- | Lib/test/test_venv.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py index c685a65..4e18dfc 100644 --- a/Lib/test/test_venv.py +++ b/Lib/test/test_venv.py @@ -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: |