@@ -597,7 +597,7 @@ function TPyDBField.CheckField : Boolean;
597597 if  not  Assigned(DelphiObject) then  begin 
598598   Result := False;
599599   with  GetPythonEngine do 
600-      PyErr_SetString  (PyExc_RuntimeError^, PAnsiChar(' No field defined !' 
600+      PyErr_SetString(PyExc_RuntimeError^, PAnsiChar(' No field defined !' 
601601 end 
602602 else 
603603   Result := True;
@@ -978,7 +978,7 @@ function TPyDBDataset.Do_Fields( args : PPyObject ): PPyObject;
978978          Result := PyDelphiWrapper.Wrap(l_oDataset.Fields[idx])
979979        else  begin 
980980          Result := nil ;
981-           PyErr_SetString  (PyExc_AttributeError^, PAnsiChar(AnsiString (Format(' Value out of range : %d' 
981+           PyErr_SetString(PyExc_AttributeError^, PAnsiChar(EncodeString (Format(' Value out of range : %d' 
982982        end ;
983983      end 
984984      else 
@@ -1011,7 +1011,7 @@ function TPyDBDataset.Do_FieldByName( args : PPyObject ) : PPyObject;
10111011          Result := PyDelphiWrapper.Wrap(fld)
10121012        else  begin 
10131013          Result := nil ;
1014-           PyErr_SetString  (PyExc_AttributeError^, PAnsiChar(AnsiString(Format(' Unknown field "%s"' 
1014+           PyErr_SetString(PyExc_AttributeError^, PAnsiChar(AnsiString(Format(' Unknown field "%s"' 
10151015        end ;
10161016      end 
10171017      else 
@@ -1191,7 +1191,7 @@ function TPyDBDataset.Do_Locate( args : PPyObject ) : PPyObject;
11911191    try 
11921192      if  PyArg_ParseTuple( args, ' sOO:DBDataset.Locate' 0  then  begin 
11931193        if  PySequence_Check(options) = 0  then 
1194-           PyErr_SetString  (PyExc_AttributeError^, ' Third argument of Locate must be a sequence.' 
1194+           PyErr_SetString(PyExc_AttributeError^, ' Third argument of Locate must be a sequence.' 
11951195        else  begin 
11961196          //  Prepare the locate options
11971197          ListToSet( options, @opt, sizeof(opt) );
@@ -1391,14 +1391,14 @@ function TPyDBTable.CheckActiveDBTable(aMustOpen: Boolean): Boolean;
13911391    if  not  aMustOpen then  begin 
13921392      Result := False;
13931393      with  GetPythonEngine do 
1394-         PyErr_SetString  (PyExc_RuntimeError^, PAnsiChar(' DBTable is open!' 
1394+         PyErr_SetString(PyExc_RuntimeError^, PAnsiChar(' DBTable is open!' 
13951395    end ;
13961396  end 
13971397  else  begin 
13981398    if  aMustOpen then  begin 
13991399      Result := False;
14001400      with  GetPythonEngine do 
1401-         PyErr_SetString  (PyExc_RuntimeError^, PAnsiChar(' DBTable is not open!' 
1401+         PyErr_SetString(PyExc_RuntimeError^, PAnsiChar(' DBTable is not open!' 
14021402    end ;
14031403  end ;
14041404end ;
@@ -1838,10 +1838,10 @@ function TPyDBTable.Do_SetRange( args : PPyObject ) : PPyObject;
18381838      if  l_oTable.Active and 
18391839        (PyArg_ParseTuple( args, ' OO:FDTable.SetRange' 0 ) then  begin 
18401840        if  PySequence_Check(l_oPyStartValues) = 0  then  begin 
1841-           PyErr_SetString  (PyExc_AttributeError^, ' First argument of SetRange must be a sequence.' 
1841+           PyErr_SetString(PyExc_AttributeError^, ' First argument of SetRange must be a sequence.' 
18421842        end 
18431843        else  if  PySequence_Check(l_oPyEndValues) = 0  then  begin 
1844-           PyErr_SetString  (PyExc_AttributeError^, ' Second argument of SetRange must be a sequence.' 
1844+           PyErr_SetString(PyExc_AttributeError^, ' Second argument of SetRange must be a sequence.' 
18451845        end 
18461846        else  begin 
18471847          l_oTable.SetRangeStart;
@@ -1952,14 +1952,14 @@ function TPyDBQuery.CheckActiveDBQuery(aMustOpen: Boolean): Boolean;
19521952    if  not  aMustOpen then  begin 
19531953      Result := False;
19541954      with  GetPythonEngine do 
1955-         PyErr_SetString  (PyExc_RuntimeError^, PAnsiChar(' DBQuery is open!' 
1955+         PyErr_SetString(PyExc_RuntimeError^, PAnsiChar(' DBQuery is open!' 
19561956    end ;
19571957  end 
19581958  else  begin 
19591959    if  aMustOpen then  begin 
19601960      Result := False;
19611961      with  GetPythonEngine do 
1962-         PyErr_SetString  (PyExc_RuntimeError^, PAnsiChar(' DBQuery is not open!' 
1962+         PyErr_SetString(PyExc_RuntimeError^, PAnsiChar(' DBQuery is not open!' 
19631963    end ;
19641964  end ;
19651965end ;
0 commit comments