Mark setter as raising on negative results

Fixed static check of psyco_conn_cursor().
This commit is contained in:
Daniele Varrazzo 2018-12-28 18:03:24 +01:00
parent 4644715164
commit daff2ea1be
3 changed files with 6 additions and 6 deletions

View File

@ -112,10 +112,10 @@ psyco_conn_cursor(connectionObject *self, PyObject *args, PyObject *kwargs)
goto exit;
}
if (0 != psyco_curs_withhold_set((cursorObject *)obj, withhold)) {
if (0 > psyco_curs_withhold_set((cursorObject *)obj, withhold)) {
goto exit;
}
if (0 != psyco_curs_scrollable_set((cursorObject *)obj, scrollable)) {
if (0 > psyco_curs_scrollable_set((cursorObject *)obj, scrollable)) {
goto exit;
}

View File

@ -93,8 +93,8 @@ struct cursorObject {
/* C-callable functions in cursor_int.c and cursor_type.c */
BORROWED HIDDEN PyObject *curs_get_cast(cursorObject *self, PyObject *oid);
HIDDEN void curs_reset(cursorObject *self);
HIDDEN int psyco_curs_withhold_set(cursorObject *self, PyObject *pyvalue);
HIDDEN int psyco_curs_scrollable_set(cursorObject *self, PyObject *pyvalue);
RAISES_NEG HIDDEN int psyco_curs_withhold_set(cursorObject *self, PyObject *pyvalue);
RAISES_NEG HIDDEN int psyco_curs_scrollable_set(cursorObject *self, PyObject *pyvalue);
HIDDEN PyObject *psyco_curs_validate_sql_basic(cursorObject *self, PyObject *sql);
/* exception-raising macros */

View File

@ -1681,7 +1681,7 @@ psyco_curs_withhold_get(cursorObject *self)
return PyBool_FromLong(self->withhold);
}
int
RAISES_NEG int
psyco_curs_withhold_set(cursorObject *self, PyObject *pyvalue)
{
int value;
@ -1726,7 +1726,7 @@ psyco_curs_scrollable_get(cursorObject *self)
return ret;
}
int
RAISES_NEG int
psyco_curs_scrollable_set(cursorObject *self, PyObject *pyvalue)
{
int value;