File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -435,21 +435,18 @@ function PythonVersionFromPath(const Path: string; out PythonVersion: TPythonVer
435
435
436
436
function FindPythonDLL (APath : string): string;
437
437
Var
438
- FindFileData: TWIN32FindData;
439
- Handle : THandle;
440
438
DLLFileName: string;
439
+ I: integer;
441
440
begin
442
441
Result := ' ' ;
443
- Handle := FindFirstFile(PWideChar(APath+' \python??.dll' ), FindFileData);
444
- if Handle = INVALID_HANDLE_VALUE then Exit; // not python dll
445
- DLLFileName:= FindFileData.cFileName;
446
- // skip if python3.dll was found
447
- if Length(DLLFileName) <> 12 then FindNextFile(Handle, FindFileData);
448
- if Handle = INVALID_HANDLE_VALUE then Exit;
449
- Windows.FindClose(Handle);
450
- DLLFileName:= FindFileData.cFileName;
451
- if Length(DLLFileName) = 12 then
452
- Result := DLLFileName;
442
+ APath := IncludeTrailingPathDelimiter(APath);
443
+ for I := High(PYTHON_KNOWN_VERSIONS) downto COMPILED_FOR_PYTHON_VERSION_INDEX do begin
444
+ DLLFileName := PYTHON_KNOWN_VERSIONS[I].DLLName;
445
+ if FileExists(APath+DLLFileName) then begin
446
+ Result := DLLFileName;
447
+ exit;
448
+ end ;
449
+ end ;
453
450
end ;
454
451
455
452
function GetVenvBasePrefix (InstallPath: string): string;
You can’t perform that action at this time.
0 commit comments