File tree 3 files changed +20
-9
lines changed
3 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,6 @@ object Form1: TForm1
10
10
Font.Height = -11
11
11
Font.Name = ' MS Sans Serif'
12
12
Font.Style = []
13
- OldCreateOrder = True
14
- PixelsPerInch = 96
15
13
TextHeight = 13
16
14
object Splitter1: TSplitter
17
15
Left = 0
@@ -20,7 +18,6 @@ object Form1: TForm1
20
18
Height = 3
21
19
Cursor = crVSplit
22
20
Align = alTop
23
- ExplicitWidth = 536
24
21
end
25
22
object Memo1: TMemo
26
23
Left = 0
Original file line number Diff line number Diff line change @@ -151,6 +151,8 @@ procedure PyPoint_dealloc(obj : PPyObject); cdecl;
151
151
// object.value
152
152
// object.method(args)
153
153
function PyPoint_getattr (obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl;
154
+ var
155
+ Py_Key: PPyObject;
154
156
begin
155
157
with GetPythonEngine, PPyPoint(obj)^ do
156
158
begin
@@ -163,9 +165,14 @@ function PyPoint_getattr(obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl;
163
165
else
164
166
begin
165
167
// Else check for a method
166
- Result := PyObject_GenericGetAttr(obj, PyUnicodeFromString(key));
167
- if not Assigned(Result) then
168
- PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Utf8Encode(Format(' Unknown attribute "%s"' ,[key]))));
168
+ Py_Key := PyUnicodeFromString(key);
169
+ try
170
+ Result := PyObject_GenericGetAttr(obj, Py_key);
171
+ if not Assigned(Result) then
172
+ PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Utf8Encode(Format(' Unknown attribute "%s"' ,[key]))));
173
+ finally
174
+ Py_DECREF(Py_Key);
175
+ end ;
169
176
end ;
170
177
end ;
171
178
end ;
Original file line number Diff line number Diff line change @@ -191,6 +191,8 @@ procedure PyPoint_dealloc(obj : PPyObject); cdecl;
191
191
// object.value
192
192
// object.method(args)
193
193
function PyPoint_getattr (obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl;
194
+ var
195
+ Py_Key: PPyObject;
194
196
begin
195
197
with GetPythonEngine, PPyPoint(obj)^ do
196
198
begin
@@ -203,9 +205,14 @@ function PyPoint_getattr(obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl;
203
205
else
204
206
begin
205
207
// Else check for a method
206
- Result := PyObject_GenericGetAttr(obj, PyUnicodeFromString(key));
207
- if not Assigned(Result) then
208
- PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Utf8Encode(Format(' Unknown attribute "%s"' ,[key]))));
208
+ Py_Key := PyUnicodeFromString(key);
209
+ try
210
+ Result := PyObject_GenericGetAttr(obj, Py_Key);
211
+ if not Assigned(Result) then
212
+ PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Utf8Encode(Format(' Unknown attribute "%s"' ,[key]))));
213
+ finally
214
+ Py_DECREF(Py_Key);
215
+ end ;
209
216
end ;
210
217
end ;
211
218
end ;
You can’t perform that action at this time.
0 commit comments