Skip to content

Commit 7eb051e

Browse files
committed
GenericSetAttrO raises the AttributeError on failure. No need to raise it again.
1 parent c113a4f commit 7eb051e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Source/WrapDelphi.pas

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3559,7 +3559,7 @@ function TPyDelphiObject.GetAttrO(key: PPyObject): PPyObject;
35593559
Result := nil;
35603560
PyEngine := GetPythonEngine;
35613561

3562-
// If DelphiObject is nil Exit immediately with an error
3562+
// If DelphiObject is nil exit immediately with an error
35633563
if not Assigned(DelphiObject) then
35643564
begin
35653565
PyEngine.PyErr_SetObject(PyEngine.PyExc_AttributeError^,
@@ -3953,7 +3953,7 @@ function TPyDelphiObject.SetAttrO(key, value: PPyObject): Integer;
39533953
Result := -1;
39543954
PyEngine := GetPythonEngine;
39553955

3956-
// If DelphiObject is nil Exit immediately with an error
3956+
// If DelphiObject is nil exit immediately with an error
39573957
if not Assigned(DelphiObject) then
39583958
begin
39593959
PyEngine.PyErr_SetObject(PyEngine.PyExc_AttributeError^,
@@ -4001,10 +4001,6 @@ function TPyDelphiObject.SetAttrO(key, value: PPyObject): Integer;
40014001
// Subclasses have a __dict__ and can set extra fields
40024002
if Result <> 0 then
40034003
Result := inherited SetAttrO(key, value);
4004-
if Result <> 0 then
4005-
with PyEngine do
4006-
PyErr_SetObject(PyExc_AttributeError^, PyUnicodeFromString(
4007-
Format(rs_ErrAttrSet, [KeyName, ErrMsg])));
40084004
end;
40094005

40104006
procedure TPyDelphiObject.SetDelphiObject(const Value: TObject);

0 commit comments

Comments
 (0)