File tree 1 file changed +11
-0
lines changed
Filter options
PythonForDelphi/Components/Sources/Core
1 file changed +11
-0
lines changed
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ TPythonVersion = record
25
25
function GetIsPython3K : Boolean;
26
26
function GetHelpFile : string;
27
27
function GetDisplayName : string;
28
+ function GetApiVersion : integer;
28
29
public
29
30
IsRegistered: Boolean;
30
31
IsAllUsers: Boolean;
@@ -39,6 +40,7 @@ TPythonVersion = record
39
40
property IsPython3K: Boolean read GetIsPython3K;
40
41
property HelpFile: string read GetHelpFile write FHelpFile;
41
42
property DisplayName: string read GetDisplayName write FDisplayName;
43
+ property ApiVersion: integer read GetApiVersion;
42
44
end ;
43
45
44
46
TPythonVersions = array of TPythonVersion;
@@ -106,9 +108,18 @@ procedure TPythonVersion.AssignTo(PythonEngine: TPersistent);
106
108
TPythonEngine(PythonEngine).RegVersion := SysVersion;
107
109
TPythonEngine(PythonEngine).DllName := DLLName;
108
110
TPythonEngine(PythonEngine).DllPath := DLLPath;
111
+ TPythonEngine(PythonEngine).APIVersion := ApiVersion;
109
112
end ;
110
113
end ;
111
114
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
+
112
123
function TPythonVersion.GetDisplayName : string;
113
124
begin
114
125
Result := FDisplayName;
You can’t perform that action at this time.
0 commit comments