From: Billy G. A. <bal...@us...> - 2001-10-01 01:26:59
|
Update of /cvsroot/pypgsql/pypgsql In directory usw-pr-cvs1:/tmp/cvs-serv32323 Modified Files: pgresult.c Log Message: 30SEP2001 bga Change error message returned by PgResult_ntuple_check if no tuples were returned in the result. The returned error message now makes sense. Index: pgresult.c =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/pgresult.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** pgresult.c 2001/09/24 07:10:56 1.12 --- pgresult.c 2001/10/01 01:26:56 1.13 *************** *** 29,32 **** --- 29,35 ---- | Date Ini Description | | --------- --- ------------------------------------------------------- | + | 30SEP2001 bga Change error message returned by PgResult_ntuple_check | + | if no tuples were returned in the result. The returned | + | error message now makes sense. | | 24SEP2001 bga Added support for the PostgreSQL BYTEA type. | | 21SEP2001 bga I have removed resultErrorMessage as an attribute. It | *************** *** 237,242 **** char buf[256]; ! sprintf(buf, "tuple index outside valid range of 0..%ld.", ! (PyInt_AS_LONG(self->ntuples) - 1)); PyErr_SetString(PyExc_ValueError, buf); return FALSE; --- 240,248 ---- char buf[256]; ! if (PyInt_AS_LONG(self->ntuples) > 0) ! sprintf(buf, "tuple index outside valid range of 0..%ld.", ! (PyInt_AS_LONG(self->ntuples) - 1)); ! else ! strcpy(buf, "result does not contain any tuples.") PyErr_SetString(PyExc_ValueError, buf); return FALSE; |