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;
78007800 finally
78017801 Py_XDecRef(PyKey);
78027802 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])));
78127803 end ;
78137804end ;
78147805
Original file line number Diff line number Diff line change @@ -170,9 +170,7 @@ function PyPoint_getattr(obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl;
170170 else
171171 begin
172172 // 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));
176174 if not Assigned(Result) then
177175 PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format(' Unknown attribute "%s"' ,[key])));
178176 end ;
Original file line number Diff line number Diff line change @@ -208,9 +208,7 @@ function PyPoint_getattr(obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl;
208208 else
209209 begin
210210 // 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));
214212 if not Assigned(Result) then
215213 PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format(' Unknown attribute "%s"' ,[key])));
216214 end ;
Original file line number Diff line number Diff line change @@ -173,9 +173,7 @@ function PyPoint_getattr(obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl;
173173 else
174174 begin
175175 // 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));
179177 if not Assigned(Result) then
180178 PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format(' Unknown attribute "%s"' ,[key])));
181179 end ;
You can’t perform that action at this time.
0 commit comments