Skip to content

Commit 603a9f6

Browse files
committed
Removed InitThreads property and deprecated PyEval_InitThreads which does nothing since python 3.7.
1 parent 6cd46ca commit 603a9f6

File tree

9 files changed

+0
-26
lines changed

9 files changed

+0
-26
lines changed

Demos/Demo11/ThSort.dfm

-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ object ThreadSortForm: TThreadSortForm
165165
OnClick = SaveBtnClick
166166
end
167167
object PythonEngine1: TPythonEngine
168-
InitThreads = True
169168
RedirectIO = False
170169
Left = 16
171170
Top = 32

Demos/Demo33/ThSort.dfm

-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ object ThreadSortForm: TThreadSortForm
171171
OnClick = StopBtnClick
172172
end
173173
object PythonEngine1: TPythonEngine
174-
InitThreads = True
175174
PyFlags = [pfDebug, pfInteractive, pfVerbose]
176175
RedirectIO = False
177176
Left = 16

Source/PythonEngine.pas

-18
Original file line numberDiff line numberDiff line change
@@ -1605,7 +1605,6 @@ TPythonInterface=class(TDynamicDll)
16051605
PyEval_GetGlobals:function :PPyObject; cdecl;
16061606
PyEval_GetLocals:function :PPyObject; cdecl;
16071607

1608-
PyEval_InitThreads:procedure; cdecl;
16091608
PyEval_RestoreThread:procedure( tstate: PPyThreadState); cdecl;
16101609
PyEval_SaveThread:function :PPyThreadState; cdecl;
16111610

@@ -2013,7 +2012,6 @@ TPythonEngine = class(TPythonInterface)
20132012
FProgramName: UnicodeString;
20142013
FPythonHome: UnicodeString;
20152014
FPythonPath: WCharTString;
2016-
FInitThreads: Boolean;
20172015
FOnSysPathInit: TSysPathInitEvent;
20182016
FTraceback: TPythonTraceback;
20192017
FUseWindowsConsole: Boolean;
@@ -2042,7 +2040,6 @@ TPythonEngine = class(TPythonInterface)
20422040
procedure DoOpenDll(const aDllName : string); override;
20432041
procedure SetInitScript(Value: TStrings);
20442042
function GetThreadState: PPyThreadState;
2045-
procedure SetInitThreads(Value: Boolean);
20462043
function GetClientCount : Integer;
20472044
function GetClients( idx : Integer ) : TEngineClient;
20482045
procedure Notification(AComponent: TComponent;
@@ -2159,7 +2156,6 @@ TPythonEngine = class(TPythonInterface)
21592156
property VenvPythonExe: string read FVenvPythonExe write FVenvPythonExe;
21602157
property DatetimeConversionMode: TDatetimeConversionMode read FDatetimeConversionMode write FDatetimeConversionMode default DEFAULT_DATETIME_CONVERSION_MODE;
21612158
property InitScript: TStrings read FInitScript write SetInitScript;
2162-
property InitThreads: Boolean read FInitThreads write SetInitThreads default False;
21632159
property IO: TPythonInputOutput read FIO write SetIO;
21642160
property PyFlags: TPythonFlags read FPyFlags write SetPyFlags default [];
21652161
property RedirectIO: Boolean read FRedirectIO write FRedirectIO default True;
@@ -3880,7 +3876,6 @@ procedure TPythonInterface.MapDll;
38803876
PyEval_GetFrame := Import('PyEval_GetFrame');
38813877
PyEval_GetGlobals := Import('PyEval_GetGlobals');
38823878
PyEval_GetLocals := Import('PyEval_GetLocals');
3883-
PyEval_InitThreads := Import('PyEval_InitThreads');
38843879
PyEval_RestoreThread := Import('PyEval_RestoreThread');
38853880
PyEval_SaveThread := Import('PyEval_SaveThread');
38863881
PyFile_GetLine := Import('PyFile_GetLine');
@@ -4555,7 +4550,6 @@ constructor TPythonEngine.Create(AOwner: TComponent);
45554550
FRedirectIO := True;
45564551
FExecModule := '__main__';
45574552
FAutoFinalize := True;
4558-
FInitThreads := False;
45594553
FTraceback := TPythonTraceback.Create;
45604554
FUseWindowsConsole := False;
45614555
FPyFlags := [];
@@ -4787,8 +4781,6 @@ procedure TPythonEngine.Initialize;
47874781
else
47884782
FInitialized := True;
47894783
InitSysPath;
4790-
if InitThreads and Assigned(PyEval_InitThreads) then
4791-
PyEval_InitThreads;
47924784
if RedirectIO and Assigned(FIO) then
47934785
DoRedirectIO;
47944786
end;
@@ -4820,16 +4812,6 @@ function TPythonEngine.GetThreadState: PPyThreadState;
48204812
Result := nil;
48214813
end;
48224814

4823-
procedure TPythonEngine.SetInitThreads(Value: Boolean);
4824-
begin
4825-
if Value <> FInitThreads then
4826-
begin
4827-
if Value and Assigned(PyEval_InitThreads) then
4828-
PyEval_InitThreads;
4829-
FInitThreads := Value;
4830-
end;
4831-
end;
4832-
48334815
procedure TPythonEngine.SetIO(InputOutput: TPythonInputOutput);
48344816
begin
48354817
if InputOutput <> fIO then

Tests/AutoWrapEventHandlerTest.pas

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ procedure TTestAutoWrapEventHandlers.SetupFixture;
7171
PythonEngine.FatalMsgDlg := True;
7272
PythonEngine.UseLastKnownVersion := True;
7373
PythonEngine.AutoFinalize := True;
74-
PythonEngine.InitThreads := True;
7574
PythonEngine.PyFlags := [pfInteractive];
7675
DelphiModule := TPythonModule.Create(nil);
7776
DelphiModule.Name := 'DelphiModule';

Tests/NumberServicesTest.pas

-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ procedure TTestNumberServices.SetupFixture;
176176
PythonEngine.UseLastKnownVersion := True;
177177

178178
PythonEngine.AutoFinalize := True;
179-
PythonEngine.InitThreads := True;
180179
PythonEngine.PyFlags := [pfInteractive];
181180
PythonEngine.LoadDll;
182181

Tests/VarPythTest.pas

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ procedure TTestVarPyth.SetupFixture;
7474
PythonEngine.UseLastKnownVersion := True;
7575

7676
PythonEngine.AutoFinalize := True;
77-
PythonEngine.InitThreads := True;
7877
PythonEngine.PyFlags := [pfInteractive];
7978
PythonEngine.LoadDll;
8079
end;

Tests/WrapDelphiEventHandlerTest.pas

-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ procedure TTestWrapDelphiEventHandlers.SetupFixture;
215215
PythonEngine.FatalMsgDlg := True;
216216
PythonEngine.UseLastKnownVersion := True;
217217
PythonEngine.AutoFinalize := True;
218-
PythonEngine.InitThreads := True;
219218
PythonEngine.PyFlags := [pfInteractive];
220219
DelphiModule := TPythonModule.Create(nil);
221220
DelphiModule.Name := 'DelphiModule';

Tests/WrapDelphiTest.pas

-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ procedure TTestWrapDelphi.SetupFixture;
202202
PythonEngine.UseLastKnownVersion := True;
203203

204204
PythonEngine.AutoFinalize := True;
205-
PythonEngine.InitThreads := True;
206205
PythonEngine.PyFlags := [pfInteractive];
207206

208207
DelphiModule := TPythonModule.Create(nil);

Tutorials/Webinar II/AnalyticsDemo/MainFormSVG.dfm

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ object Form1: TForm1
254254
Top = 89
255255
end
256256
object PythonEngine1: TPythonEngine
257-
InitThreads = True
258257
IO = PythonGUIInputOutput1
259258
Left = 632
260259
Top = 136

0 commit comments

Comments
 (0)