Skip to content

Commit 99b1561

Browse files
committed
Added ReturnTrue, ReturnFalse
1 parent e246c04 commit 99b1561

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Source/PythonEngine.pas

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,6 +1855,8 @@ TPythonEngine = class(TPythonInterface)
18551855
procedure PyListToStrings( list : PPyObject; strings : TStrings );
18561856
procedure PyTupleToStrings( tuple: PPyObject; strings : TStrings );
18571857
function ReturnNone : PPyObject;
1858+
function ReturnTrue : PPyObject;
1859+
function ReturnFalse : PPyObject;
18581860
function FindModule( const ModuleName : AnsiString ) : PPyObject;
18591861
function FindFunction(const ModuleName,FuncName: AnsiString): PPyObject;
18601862
function SetToList( data : Pointer; size : Integer ) : PPyObject;
@@ -5682,12 +5684,24 @@ function TPythonEngine.PyUnicodeFromString(const AString : UnicodeString) : PPyO
56825684
{$ENDIF}
56835685
end;
56845686

5687+
function TPythonEngine.ReturnFalse : PPyObject;
5688+
begin
5689+
Result := Py_False;
5690+
Py_INCREF( Result );
5691+
end;
5692+
56855693
function TPythonEngine.ReturnNone : PPyObject;
56865694
begin
56875695
Result := Py_None;
56885696
Py_INCREF( Result );
56895697
end;
56905698

5699+
function TPythonEngine.ReturnTrue : PPyObject;
5700+
begin
5701+
Result := Py_True;
5702+
Py_INCREF( Result );
5703+
end;
5704+
56915705
function TPythonEngine.FindModule( const ModuleName : AnsiString ) : PPyObject;
56925706
var
56935707
modules, m : PPyObject;

0 commit comments

Comments
 (0)