@@ -33,7 +33,7 @@ TPythonVersion = record
33
33
function GetDisplayName : string;
34
34
function GetApiVersion : integer;
35
35
function GetSysArchitecture : string;
36
- function GetPythonExecutable : string;
36
+ function GetPythonExecutable (Index: Integer) : string;
37
37
public
38
38
IsRegistered: Boolean;
39
39
IsAllUsers: Boolean;
@@ -46,7 +46,8 @@ TPythonVersion = record
46
46
function Is_virtualenv : Boolean;
47
47
function Is_conda : Boolean;
48
48
procedure AssignTo (PythonEngine: TPersistent);
49
- property PythonExecutable: string read GetPythonExecutable;
49
+ property PythonExecutable: string index 0 read GetPythonExecutable;
50
+ property PythonFreeThreadedExecutable: string index 1 read GetPythonExecutable;
50
51
property DLLName: string read GetDLLName;
51
52
property SysArchitecture: string read GetSysArchitecture;
52
53
property IsPython3K: Boolean read GetIsPython3K;
@@ -204,11 +205,18 @@ function TPythonVersion.GetIsPython3K: Boolean;
204
205
end ;
205
206
end ;
206
207
207
- function TPythonVersion.GetPythonExecutable : string;
208
+ function TPythonVersion.GetPythonExecutable (Index: Integer): string;
209
+ var
210
+ ExeName: string;
208
211
begin
209
- Result := IncludeTrailingPathDelimiter(InstallPath) + ' python.exe' ;
212
+ if Index = 0 then
213
+ ExeName := ' python.exe'
214
+ else
215
+ ExeName := Format(' python%st.exe' , [SysVersion]);
216
+
217
+ Result := IncludeTrailingPathDelimiter(InstallPath) + ExeName;
210
218
if not FileExists(Result) then begin
211
- Result := IncludeTrailingPathDelimiter(InstallPath) + ' Scripts' + PathDelim + ' python.exe ' ;
219
+ Result := IncludeTrailingPathDelimiter(InstallPath) + ' Scripts' + PathDelim + ExeName ;
212
220
if not FileExists(Result) then Result := ' ' ;
213
221
end ;
214
222
end ;
0 commit comments