File tree Expand file tree Collapse file tree 4 files changed +3
-18
lines changed Expand file tree Collapse file tree 4 files changed +3
-18
lines changed Original file line number Diff line number Diff line change @@ -7800,15 +7800,6 @@ function TPyObject.GetAttr(key : PAnsiChar) : PPyObject;
7800
7800
finally
7801
7801
Py_XDecRef(PyKey);
7802
7802
end ;
7803
-
7804
- // // check for a method
7805
- // if IsPython3000 then
7806
- // // I think Python 3000 from beta 2 gets the methods from the tp_methods field
7807
- // Result := nil
7808
- // else
7809
- // Result := Py_FindMethod( PythonType.MethodsData, GetSelf, key);
7810
- // if not Assigned(Result) then
7811
- // PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format('Unknown attribute "%s"',[key])));
7812
7803
end ;
7813
7804
end ;
7814
7805
Original file line number Diff line number Diff line change @@ -170,9 +170,7 @@ function PyPoint_getattr(obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl;
170
170
else
171
171
begin
172
172
// Else check for a method
173
- Result := Py_FindMethod( MethodsByName(' PythonType1' ), obj, key);
174
- // or we could write, because it's quicker:
175
- // Result := Py_FindMethod( Form1.PythonType1.MethodsData, obj, key);
173
+ Result := PyObject_GenericGetAttr(obj, PyString_FromString(key));
176
174
if not Assigned(Result) then
177
175
PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format(' Unknown attribute "%s"' ,[key])));
178
176
end ;
Original file line number Diff line number Diff line change @@ -208,9 +208,7 @@ function PyPoint_getattr(obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl;
208
208
else
209
209
begin
210
210
// Else check for a method
211
- Result := Py_FindMethod( MethodsByName(' PythonType1' ), obj, key);
212
- // or we could write, because it's quicker:
213
- // Result := Py_FindMethod( Form1.PythonType1.MethodsData, obj, key);
211
+ Result := PyObject_GenericGetAttr(obj, PyString_FromString(key));
214
212
if not Assigned(Result) then
215
213
PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format(' Unknown attribute "%s"' ,[key])));
216
214
end ;
Original file line number Diff line number Diff line change @@ -173,9 +173,7 @@ function PyPoint_getattr(obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl;
173
173
else
174
174
begin
175
175
// Else check for a method
176
- Result := Py_FindMethod( MethodsByName(' PythonType1' ), obj, key);
177
- // or we could write, because it's quicker:
178
- // Result := Py_FindMethod( Form1.PythonType1.MethodsData, obj, key);
176
+ Result := PyObject_GenericGetAttr(obj, PyString_FromString(key));
179
177
if not Assigned(Result) then
180
178
PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format(' Unknown attribute "%s"' ,[key])));
181
179
end ;
You can’t perform that action at this time.
0 commit comments