Skip to content

Commit 933f383

Browse files
committed
1 parent 88778db commit 933f383

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Source/PythonEngine.pas

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1795,6 +1795,7 @@ TPythonEngine = class(TPythonInterface)
17951795
procedure SetGlobalVars(const Value: PPyObject);
17961796
procedure SetLocalVars(const Value: PPyObject);
17971797
procedure SetPyFlags(const Value: TPythonFlags);
1798+
procedure SetIO(InputOutput: TPythonInputOutput);
17981799
procedure AssignPyFlags;
17991800

18001801
public
@@ -1896,7 +1897,7 @@ TPythonEngine = class(TPythonInterface)
18961897
property DatetimeConversionMode: TDatetimeConversionMode read FDatetimeConversionMode write FDatetimeConversionMode default DEFAULT_DATETIME_CONVERSION_MODE;
18971898
property InitScript: TStrings read FInitScript write SetInitScript;
18981899
property InitThreads: Boolean read FInitThreads write SetInitThreads default False;
1899-
property IO: TPythonInputOutput read FIO write FIO;
1900+
property IO: TPythonInputOutput read FIO write SetIO;
19001901
property PyFlags: TPythonFlags read FPyFlags write SetPyFlags default [];
19011902
property RedirectIO: Boolean read FRedirectIO write FRedirectIO default True;
19021903
property UseWindowsConsole: Boolean read FUseWindowsConsole write FUseWindowsConsole default False;
@@ -4244,6 +4245,18 @@ procedure TPythonEngine.SetInitThreads(Value: Boolean);
42444245
end;
42454246
end;
42464247

4248+
procedure TPythonEngine.SetIO(InputOutput: TPythonInputOutput);
4249+
begin
4250+
if InputOutput <> fIO then
4251+
begin
4252+
if Assigned(fIO) then
4253+
fIO.RemoveFreeNotification(Self);
4254+
fIO := InputOutput;
4255+
if Assigned(fIO) then
4256+
fIO.FreeNotification(Self);
4257+
end;
4258+
end;
4259+
42474260
function TPythonEngine.GetClientCount : Integer;
42484261
begin
42494262
Result := FClients.Count;

0 commit comments

Comments
 (0)