Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d0885e2

Browse files
committedFeb 16, 2021
sync P4D, about TPyVar
1 parent faf072f commit d0885e2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed
 

‎python4lazarus/PythonEngine.pas

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2581,8 +2581,8 @@ TPyVar = class(TPyObject)
25812581
////////////////
25822582

25832583
// Basic services
2584-
function GetAttr(key : PAnsiChar) : PPyObject; override;
2585-
function SetAttr(key : PAnsiChar; value : PPyObject) : Integer; override;
2584+
function GetAttrO( key: PPyObject) : PPyObject; override;
2585+
function SetAttrO( key, value: PPyObject) : Integer; override;
25862586
function Repr : PPyObject; override;
25872587

25882588
// Class methods
@@ -8279,26 +8279,26 @@ destructor TPyVar.Destroy;
82798279

82808280
// Then we override the needed services
82818281

8282-
function TPyVar.GetAttr(key : PAnsiChar) : PPyObject;
8282+
function TPyVar.GetAttrO( key: PPyObject) : PPyObject;
82838283
begin
82848284
with GetPythonEngine do
82858285
begin
8286-
if CompareText( AnsiString(key), 'Value') = 0 then
8286+
if CompareText( PyObjectAsString(key), 'Value') = 0 then
82878287
Result := GetValue
82888288
else
8289-
Result := inherited GetAttr(key);
8289+
Result := inherited GetAttrO(key);
82908290
end;
82918291
end;
82928292

8293-
function TPyVar.SetAttr(key : PAnsiChar; value : PPyObject) : Integer;
8293+
function TPyVar.SetAttrO( key, value: PPyObject) : Integer;
82948294
begin
82958295
Result := 0;
82968296
with GetPythonEngine do
82978297
begin
8298-
if CompareText( AnsiString(key), 'Value' ) = 0 then
8298+
if CompareText( PyObjectAsString(key), 'Value' ) = 0 then
82998299
SetValue( value )
83008300
else
8301-
Result := inherited SetAttr(key, value);
8301+
Result := inherited SetAttrO(key, value);
83028302
end;
83038303
end;
83048304

0 commit comments

Comments
 (0)
Please sign in to comment.