@@ -597,7 +597,7 @@ function TPyDBField.CheckField : Boolean;
597
597
if not Assigned(DelphiObject) then begin
598
598
Result := False;
599
599
with GetPythonEngine do
600
- PyErr_SetString (PyExc_RuntimeError^, PAnsiChar(' No field defined !' ) );
600
+ PyErr_SetString(PyExc_RuntimeError^, PAnsiChar(' No field defined !' ) );
601
601
end
602
602
else
603
603
Result := True;
@@ -978,7 +978,7 @@ function TPyDBDataset.Do_Fields( args : PPyObject ): PPyObject;
978
978
Result := PyDelphiWrapper.Wrap(l_oDataset.Fields[idx])
979
979
else begin
980
980
Result := nil ;
981
- PyErr_SetString (PyExc_AttributeError^, PAnsiChar(AnsiString (Format(' Value out of range : %d' , [idx]))));
981
+ PyErr_SetString(PyExc_AttributeError^, PAnsiChar(EncodeString (Format(' Value out of range : %d' , [idx]))));
982
982
end ;
983
983
end
984
984
else
@@ -1011,7 +1011,7 @@ function TPyDBDataset.Do_FieldByName( args : PPyObject ) : PPyObject;
1011
1011
Result := PyDelphiWrapper.Wrap(fld)
1012
1012
else begin
1013
1013
Result := nil ;
1014
- PyErr_SetString (PyExc_AttributeError^, PAnsiChar(AnsiString(Format(' Unknown field "%s"' , [String(s)]))) );
1014
+ PyErr_SetString(PyExc_AttributeError^, PAnsiChar(AnsiString(Format(' Unknown field "%s"' , [String(s)]))) );
1015
1015
end ;
1016
1016
end
1017
1017
else
@@ -1191,7 +1191,7 @@ function TPyDBDataset.Do_Locate( args : PPyObject ) : PPyObject;
1191
1191
try
1192
1192
if PyArg_ParseTuple( args, ' sOO:DBDataset.Locate' ,@keyFields, @keyValues, @options ) <> 0 then begin
1193
1193
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.' )
1195
1195
else begin
1196
1196
// Prepare the locate options
1197
1197
ListToSet( options, @opt, sizeof(opt) );
@@ -1391,14 +1391,14 @@ function TPyDBTable.CheckActiveDBTable(aMustOpen: Boolean): Boolean;
1391
1391
if not aMustOpen then begin
1392
1392
Result := False;
1393
1393
with GetPythonEngine do
1394
- PyErr_SetString (PyExc_RuntimeError^, PAnsiChar(' DBTable is open!' ) );
1394
+ PyErr_SetString(PyExc_RuntimeError^, PAnsiChar(' DBTable is open!' ) );
1395
1395
end ;
1396
1396
end
1397
1397
else begin
1398
1398
if aMustOpen then begin
1399
1399
Result := False;
1400
1400
with GetPythonEngine do
1401
- PyErr_SetString (PyExc_RuntimeError^, PAnsiChar(' DBTable is not open!' ) );
1401
+ PyErr_SetString(PyExc_RuntimeError^, PAnsiChar(' DBTable is not open!' ) );
1402
1402
end ;
1403
1403
end ;
1404
1404
end ;
@@ -1838,10 +1838,10 @@ function TPyDBTable.Do_SetRange( args : PPyObject ) : PPyObject;
1838
1838
if l_oTable.Active and
1839
1839
(PyArg_ParseTuple( args, ' OO:FDTable.SetRange' ,@l_oPyStartValues, @l_oPyEndValues ) <> 0 ) then begin
1840
1840
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.' );
1842
1842
end
1843
1843
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.' );
1845
1845
end
1846
1846
else begin
1847
1847
l_oTable.SetRangeStart;
@@ -1952,14 +1952,14 @@ function TPyDBQuery.CheckActiveDBQuery(aMustOpen: Boolean): Boolean;
1952
1952
if not aMustOpen then begin
1953
1953
Result := False;
1954
1954
with GetPythonEngine do
1955
- PyErr_SetString (PyExc_RuntimeError^, PAnsiChar(' DBQuery is open!' ) );
1955
+ PyErr_SetString(PyExc_RuntimeError^, PAnsiChar(' DBQuery is open!' ) );
1956
1956
end ;
1957
1957
end
1958
1958
else begin
1959
1959
if aMustOpen then begin
1960
1960
Result := False;
1961
1961
with GetPythonEngine do
1962
- PyErr_SetString (PyExc_RuntimeError^, PAnsiChar(' DBQuery is not open!' ) );
1962
+ PyErr_SetString(PyExc_RuntimeError^, PAnsiChar(' DBQuery is not open!' ) );
1963
1963
end ;
1964
1964
end ;
1965
1965
end ;
0 commit comments