File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -477,18 +477,17 @@ bool AddPythonDLLToSearchPath() {
477477#endif
478478
479479#ifdef LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME
480- // / Returns whether `python3x.dll` is in the DLL search path .
480+ // / Returns true if `python3x.dll` can be loaded .
481481bool IsPythonDLLInPath () {
482482#define WIDEN2 (x ) L##x
483483#define WIDEN (x ) WIDEN2(x)
484- WCHAR foundPath[MAX_PATH];
485- DWORD result =
486- SearchPathW (nullptr , WIDEN (LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME), nullptr ,
487- MAX_PATH, foundPath, nullptr );
484+ HMODULE h = LoadLibraryW (WIDEN (LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME));
485+ if (!h)
486+ return false ;
487+ FreeLibrary (h);
488+ return true ;
488489#undef WIDEN2
489490#undef WIDEN
490-
491- return result > 0 ;
492491}
493492#endif
494493
You can’t perform that action at this time.
0 commit comments