File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
PythonForDelphi/Components/Sources/Core Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ TPythonVersion = record
2525 function GetIsPython3K : Boolean;
2626 function GetHelpFile : string;
2727 function GetDisplayName : string;
28+ function GetApiVersion : integer;
2829 public
2930 IsRegistered: Boolean;
3031 IsAllUsers: Boolean;
@@ -39,6 +40,7 @@ TPythonVersion = record
3940 property IsPython3K: Boolean read GetIsPython3K;
4041 property HelpFile: string read GetHelpFile write FHelpFile;
4142 property DisplayName: string read GetDisplayName write FDisplayName;
43+ property ApiVersion: integer read GetApiVersion;
4244 end ;
4345
4446 TPythonVersions = array of TPythonVersion;
@@ -106,9 +108,18 @@ procedure TPythonVersion.AssignTo(PythonEngine: TPersistent);
106108 TPythonEngine(PythonEngine).RegVersion := SysVersion;
107109 TPythonEngine(PythonEngine).DllName := DLLName;
108110 TPythonEngine(PythonEngine).DllPath := DLLPath;
111+ TPythonEngine(PythonEngine).APIVersion := ApiVersion;
109112 end ;
110113end ;
111114
115+ function TPythonVersion.GetApiVersion : integer;
116+ begin
117+ if CompareVersions(SysVersion, 2.4 ) < 0 then
118+ Result := 1013
119+ else
120+ Result := 1012 ;
121+ end ;
122+
112123function TPythonVersion.GetDisplayName : string;
113124begin
114125 Result := FDisplayName;
You can’t perform that action at this time.
0 commit comments