Skip to content

Commit 6acd4d8

Browse files
committed
Work around false cpychecker false positive
davidmalcolm/gcc-python-plugin#158
1 parent 80c4f51 commit 6acd4d8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

psycopg/connection_type.c

+10
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,16 @@ _psyco_conn_parse_isolevel(PyObject *pyval)
474474
}
475475

476476
rv = level;
477+
478+
/* Redundant test, checked above.
479+
* Work around a cpychecker false positive.
480+
* davidmalcolm/gcc-python-plugin#158
481+
*/
482+
if (rv < 0) {
483+
PyErr_SetString(PyExc_ValueError,
484+
"isolation_level must be between 1 and 4");
485+
goto exit;
486+
}
477487
}
478488

479489
/* parse from the string -- this includes "default" */

0 commit comments

Comments
 (0)