Skip to content

Commit 7be676d

Browse files
committed
Fix PythonVersionFromPath for python 3.10
1 parent 6c4d6c7 commit 7be676d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Source/PythonVersions.pas

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,15 +440,15 @@ function PythonVersionFromPath(const Path: string; out PythonVersion: TPythonVer
440440
DLLFileName: string;
441441
begin
442442
Result := '';
443-
Handle := FindFirstFile(PWideChar(APath+'\python??.dll'), FindFileData);
443+
Handle := FindFirstFile(PWideChar(APath+'\python*.dll'), FindFileData);
444444
if Handle = INVALID_HANDLE_VALUE then Exit; // not python dll
445445
DLLFileName:= FindFileData.cFileName;
446446
// skip if python3.dll was found
447-
if Length(DLLFileName) <> 12 then FindNextFile(Handle, FindFileData);
447+
if Length(DLLFileName) <= 11 then FindNextFile(Handle, FindFileData);
448448
if Handle = INVALID_HANDLE_VALUE then Exit;
449449
Windows.FindClose(Handle);
450450
DLLFileName:= FindFileData.cFileName;
451-
if Length(DLLFileName) = 12 then
451+
if Length(DLLFileName) > 11 then
452452
Result := DLLFileName;
453453
end;
454454

0 commit comments

Comments
 (0)