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 @@ -487,18 +487,17 @@ bool AddPythonDLLToSearchPath() {
487487#endif
488488
489489#ifdef LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME
490- // / Returns whether `python3x.dll` is in the DLL search path .
490+ // / Returns true if `python3x.dll` can be loaded .
491491bool IsPythonDLLInPath () {
492492#define WIDEN2 (x ) L##x
493493#define WIDEN (x ) WIDEN2(x)
494- WCHAR foundPath[MAX_PATH];
495- DWORD result =
496- SearchPathW (nullptr , WIDEN (LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME), nullptr ,
497- MAX_PATH, foundPath, nullptr );
494+ HMODULE h = LoadLibraryW (WIDEN (LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME));
495+ if (!h)
496+ return false ;
497+ FreeLibrary (h);
498+ return true ;
498499#undef WIDEN2
499500#undef WIDEN
500-
501- return result > 0 ;
502501}
503502#endif
504503
You can’t perform that action at this time.
0 commit comments