99 */
1010package com .ziclix .python .sql ;
1111
12- import com .ziclix .python .sql .util .PyArgParser ;
12+ import java .sql .DatabaseMetaData ;
13+ import java .sql .SQLException ;
14+ import java .sql .SQLWarning ;
15+ import java .sql .Statement ;
16+ import java .util .List ;
1317import org .python .core .ClassDictInit ;
1418import org .python .core .Py ;
15- import org .python .core .PyBuiltinFunctionSet ;
19+ import org .python .core .PyBuiltinMethodSet ;
1620import org .python .core .PyClass ;
1721import org .python .core .PyDictionary ;
1822import org .python .core .PyException ;
2125import org .python .core .PyObject ;
2226import org .python .core .PyString ;
2327import org .python .core .PyTuple ;
24-
25- import java .sql .DatabaseMetaData ;
26- import java .sql .SQLException ;
27- import java .sql .SQLWarning ;
28- import java .sql .Statement ;
29- import java .util .List ;
28+ import com .ziclix .python .sql .util .PyArgParser ;
3029
3130/**
3231 * These objects represent a database cursor, which is used to manage the
@@ -874,12 +873,12 @@ public static boolean isSeqSeq(PyObject object) {
874873 }
875874}
876875
877- class CursorFunc extends PyBuiltinFunctionSet {
876+ class CursorFunc extends PyBuiltinMethodSet {
878877 CursorFunc (String name , int index , int argcount , String doc ) {
879- super (name , index , argcount , argcount , true , doc );
878+ super (name , index , argcount , argcount , doc );
880879 }
881880 CursorFunc (String name , int index , int minargs , int maxargs , String doc ) {
882- super (name , index , minargs , maxargs , true , doc );
881+ super (name , index , minargs , maxargs , doc );
883882 }
884883
885884 public PyObject __call__ () {
@@ -897,7 +896,7 @@ public PyObject __call__() {
897896 case 4 :
898897 return cursor .nextset ();
899898 default :
900- throw argCountError ( 0 );
899+ throw info . unexpectedCall ( 0 , false );
901900 }
902901 }
903902
@@ -927,7 +926,7 @@ public PyObject __call__(PyObject arg) {
927926 case 12 :
928927 return cursor .prepare (arg );
929928 default :
930- throw argCountError ( 1 );
929+ throw info . unexpectedCall ( 1 , false );
931930 }
932931 }
933932
@@ -949,7 +948,7 @@ public PyObject __call__(PyObject arga, PyObject argb) {
949948 cursor .scroll (((PyInteger )arga .__int__ ()).getValue (), argb .toString ());
950949 return Py .None ;
951950 default :
952- throw argCountError ( 2 );
951+ throw info . unexpectedCall ( 2 , false );
953952 }
954953 }
955954
@@ -966,7 +965,7 @@ public PyObject __call__(PyObject arga, PyObject argb, PyObject argc) {
966965 cursor .executemany (arga , argb , argc , Py .None );
967966 return Py .None ;
968967 default :
969- throw argCountError ( 3 );
968+ throw info . unexpectedCall ( 3 , false );
970969 }
971970 }
972971
@@ -994,7 +993,7 @@ public PyObject __call__(PyObject[] args, String[] keywords) {
994993 cursor .executemany (sql , params , bindings , maxrows );
995994 return Py .None ;
996995 default :
997- throw argCountError (args .length );
996+ throw info . unexpectedCall (args .length , true );
998997 }
999998 }
1000999}
0 commit comments