File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
PythonForDelphi/Components/Sources/Core Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -2069,7 +2069,6 @@ TPythonInterface=class(TDynamicDll)
20692069 procedure Py_XINCREF ( op: PPyObject);
20702070 procedure Py_XDECREF ( op: PPyObject);
20712071
2072- function Py_GetPlatform : PAnsiChar; cdecl;
20732072 function PyCode_Addr2Line ( co: PPyCodeObject; addrq : Integer ) : Integer; cdecl;
20742073 function Py_GetBuildInfo : PAnsiChar; cdecl;
20752074 function PyImport_ExecCodeModule ( const AName : AnsiString; codeobject : PPyObject) : PPyObject;
@@ -4125,11 +4124,6 @@ procedure TPythonInterface.Py_XDECREF(op: PPyObject);
41254124 if op <> nil then Py_DECREF(op);
41264125end ;
41274126
4128- function TPythonInterface.Py_GetPlatform : PAnsiChar; cdecl;
4129- begin
4130- Py_GetPlatform := ' win32' ;
4131- end ;
4132-
41334127// This function is copied from compile.c because it was not
41344128// exported in the Dll
41354129function TPythonInterface.PyCode_Addr2Line ( co: PPyCodeObject; addrq : Integer ) : Integer; cdecl;
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ TPythonVersion = record
2828 function GetDisplayName : string;
2929 function GetApiVersion : integer;
3030 function GetSysArchitecture : string;
31+ function GetPythonExecutable : string;
3132 public
3233 IsRegistered: Boolean;
3334 IsAllUsers: Boolean;
@@ -37,6 +38,7 @@ TPythonVersion = record
3738 InstallPath: string;
3839 PythonPath: string;
3940 procedure AssignTo (PythonEngine: TPersistent);
41+ property PythonExecutable: string read GetPythonExecutable;
4042 property DLLName: string read GetDLLName;
4143 property SysArchitecture: string read GetSysArchitecture;
4244 property IsPython3K: Boolean read GetIsPython3K;
@@ -156,6 +158,15 @@ function TPythonVersion.GetIsPython3K: Boolean;
156158 end ;
157159end ;
158160
161+ function TPythonVersion.GetPythonExecutable : string;
162+ begin
163+ Result := IncludeTrailingPathDelimiter(InstallPath) + ' python.exe' ;
164+ if not FileExists(Result) then begin
165+ Result := IncludeTrailingPathDelimiter(InstallPath) + ' Scripts\python.exe' ;
166+ if not FileExists(Result) then Result := ' ' ;
167+ end ;
168+ end ;
169+
159170function TPythonVersion.GetSysArchitecture : string;
160171begin
161172 Result := fSysArchitecture;
You can’t perform that action at this time.
0 commit comments