@@ -165,7 +165,7 @@ function PyPoint_getattr(obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl;
165165 // Else check for a method
166166 Result := PyObject_GenericGetAttr(obj, PyUnicodeFromString(key));
167167 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]) )));
169169 end ;
170170 end ;
171171end ;
@@ -186,7 +186,7 @@ function PyPoint_setattrfunc(obj : PPyObject; key : PAnsiChar; value : PPyObjec
186186 Result := 0 ;
187187 end
188188 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]) )));
190190 // Check for attribute y
191191 end else if key = ' y' then begin
192192 if PyLong_Check(value ) then
@@ -195,9 +195,9 @@ function PyPoint_setattrfunc(obj : PPyObject; key : PAnsiChar; value : PPyObjec
195195 Result := 0 ;
196196 end
197197 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]) )));
199199 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]) )));
201201 end ;
202202end ;
203203
0 commit comments