[lldb] make lit use the same PYTHONHOME for building and running the API tests (#154396)

When testing LLDB, we want to make sure to use the same Python as the
one we used to build it.

We already did this in https://github.com/llvm/llvm-project/pull/143183
for the Unit and Shell tests. This patch does the same thing for the API
tests as well.
This commit is contained in:
Charles Zablit
2025-08-20 14:10:50 +01:00
committed by GitHub
parent 478b4b012f
commit c56bb124e3

View File

@@ -353,6 +353,7 @@ if platform.system() == "Windows":
# Some steps required to initialize the tests dynamically link with python.dll
# and need to know the location of the Python libraries. This ensures that we
# use the same version of Python that was used to build lldb to run our tests.
config.environment["PYTHONHOME"] = config.python_root_dir
config.environment["PATH"] = os.path.pathsep.join(
(config.python_root_dir, config.environment.get("PATH", ""))
)