@@ -1290,15 +1290,11 @@ function TExposedGetSet.GetterWrapper(AObj: PPyObject; AContext : Pointer): PPyO
1290
1290
LOutMsg: string;
1291
1291
begin
1292
1292
Result := nil ;
1293
- if not ValidateClassProperty(AObj, FParentRtti.Handle, Obj, LOutMsg) then
1294
- begin
1295
- InvalidArguments(FRttiMember.Name , LOutMsg);
1296
- Exit;
1297
- end ;
1298
-
1293
+ if ValidateClassProperty(AObj, FParentRtti.Handle, Obj, LOutMsg) then
1299
1294
// TODO: Optimize out the property/field lookup, by passing FRttiMember
1300
1295
// directly to a GetRttiAttr/SetRtti overload
1301
1296
Result := GetRttiAttr(Obj, FParentRtti, FRttiMember.Name , FPyDelphiWrapper, LOutMsg);
1297
+
1302
1298
if not Assigned(Result) then
1303
1299
with GetPythonEngine do
1304
1300
PyErr_SetObject (PyExc_AttributeError^,
@@ -1311,13 +1307,9 @@ function TExposedGetSet.SetterWrapper(AObj, AValue: PPyObject; AContext: Pointer
1311
1307
LOutMsg: string;
1312
1308
begin
1313
1309
Result := -1 ;
1314
- if not ValidateClassProperty(AObj, FParentRtti.Handle, Obj, LOutMsg) then
1315
- begin
1316
- InvalidArguments(FRttiMember.Name , LOutMsg);
1317
- Exit;
1318
- end ;
1319
-
1320
- if SetRttiAttr(Obj, FParentRtti, FRttiMember.Name , AValue, FPyDelphiWrapper, LOutMsg) then
1310
+ if ValidateClassProperty(AObj, FParentRtti.Handle, Obj, LOutMsg) and
1311
+ SetRttiAttr(Obj, FParentRtti, FRttiMember.Name , AValue, FPyDelphiWrapper, LOutMsg)
1312
+ then
1321
1313
Result := 0 ;
1322
1314
1323
1315
if Result <> 0 then
0 commit comments