Skip to content

Commit 030fae1

Browse files
check if python.dll can be found after adding it to the search path
1 parent 8b34fea commit 030fae1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lldb/tools/driver/Driver.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,19 @@ bool IsPythonDLLInPath() {
492492
}
493493
#endif
494494

495+
/// Try to setup the DLL search path for the Python Runtime Library (python3xx.dll).
496+
///
497+
/// If `LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME` is set, we first check if
498+
/// python3xx.dll is in the search path. If it's not, we try to add it and
499+
/// check for it a second time.
500+
/// If only `LLDB_PYTHON_DLL_RELATIVE_PATH` is set, we try to add python3xx.dll
501+
/// to the search path python.dll is already in the search path or not.
495502
void SetupPythonRuntimeLibrary() {
496503
#ifdef LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME
497504
if (IsPythonDLLInPath())
498505
return;
499506
#ifdef LLDB_PYTHON_DLL_RELATIVE_PATH
500-
if (AddPythonDLLToSearchPath())
507+
if (AddPythonDLLToSearchPath() && IsPythonDLLInPath())
501508
return;
502509
#endif
503510
llvm::errs() << "error: unable to find '"

0 commit comments

Comments
 (0)