Skip to content

Commit

Permalink
Work around false cpychecker false positive
Browse files Browse the repository at this point in the history
  • Loading branch information
dvarrazzo committed Jan 22, 2019
1 parent 80c4f51 commit 6acd4d8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions psycopg/connection_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,16 @@ _psyco_conn_parse_isolevel(PyObject *pyval)
}

rv = level;

/* Redundant test, checked above.
* Work around a cpychecker false positive.
* davidmalcolm/gcc-python-plugin#158
*/
if (rv < 0) {
PyErr_SetString(PyExc_ValueError,
"isolation_level must be between 1 and 4");
goto exit;
}
}

/* parse from the string -- this includes "default" */
Expand Down

0 comments on commit 6acd4d8

Please sign in to comment.