]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-99370: Prefer LIBDIR from sysconfig when locating libpython for test (GH-99523)
authorSteve Dower <steve.dower@python.org>
Wed, 16 Nov 2022 21:41:13 +0000 (21:41 +0000)
committerGitHub <noreply@github.com>
Wed, 16 Nov 2022 21:41:13 +0000 (21:41 +0000)
Lib/test/test_venv.py

index c685a6554cfc708c7dae060fe0cb07338b9d89f3..4e18dfc23c40c279ffb159764e46aa0d20e009f0 100644 (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: