@@ -165,7 +165,7 @@ function PyPoint_getattr(obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl;
165
165
// Else check for a method
166
166
Result := PyObject_GenericGetAttr(obj, PyUnicodeFromString(key));
167
167
if not Assigned(Result) then
168
- PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format(' Unknown attribute "%s"' ,[key])));
168
+ PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Utf8Encode( Format(' Unknown attribute "%s"' ,[key]) )));
169
169
end ;
170
170
end ;
171
171
end ;
@@ -186,7 +186,7 @@ function PyPoint_setattrfunc(obj : PPyObject; key : PAnsiChar; value : PPyObjec
186
186
Result := 0 ;
187
187
end
188
188
else
189
- PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format(' Attribute "%s" needs an integer' ,[key])));
189
+ PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Utf8Encode( Format(' Attribute "%s" needs an integer' ,[key]) )));
190
190
// Check for attribute y
191
191
end else if key = ' y' then begin
192
192
if PyLong_Check(value ) then
@@ -195,9 +195,9 @@ function PyPoint_setattrfunc(obj : PPyObject; key : PAnsiChar; value : PPyObjec
195
195
Result := 0 ;
196
196
end
197
197
else
198
- PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format(' Attribute "%s" needs an integer' ,[key])));
198
+ PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Utf8Encode( Format(' Attribute "%s" needs an integer' ,[key]) )));
199
199
end else
200
- PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format(' Unknown attribute "%s"' ,[key])));
200
+ PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Utf8Encode( Format(' Unknown attribute "%s"' ,[key]) )));
201
201
end ;
202
202
end ;
203
203
0 commit comments