diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-11-16 15:41:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-16 15:41:18 -0800 |
commit | 0014ce7d0dbd02c0f9363202e091626df6ad613a (patch) | |
tree | e064dedc57cf84dcdba44ef49a525e82f29e68e1 | |
parent | [3.11] GH-99460: Emscripten trampolines on optimized METH_O and METH_NOARGS c... (diff) | |
download | cpython-0014ce7d0dbd02c0f9363202e091626df6ad613a.tar.gz cpython-0014ce7d0dbd02c0f9363202e091626df6ad613a.tar.bz2 cpython-0014ce7d0dbd02c0f9363202e091626df6ad613a.zip |
gh-99370: Prefer LIBDIR from sysconfig when locating libpython for test (GH-99523)
(cherry picked from commit 7c57857340befcb90394bc347c904ca62049b684)
Co-authored-by: Steve Dower <steve.dower@python.org>
-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 9e23cdf8f2b..86ce60fef13 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: |