diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c index 0c48bbf5..341f2759 100644 --- a/psycopg/cursor_type.c +++ b/psycopg/cursor_type.c @@ -904,7 +904,8 @@ _psyco_curs_has_write_check(PyObject* o, void* var) return 1; } else { - PyErr_SetString(TypeError, "argument 1 must have a .write() method"); + PyErr_SetString(PyExc_TypeError, + "argument 1 must have a .write() method"); return 0; } } diff --git a/psycopg/pqpath.c b/psycopg/pqpath.c index 54f9c4b2..89e2e2b3 100644 --- a/psycopg/pqpath.c +++ b/psycopg/pqpath.c @@ -538,7 +538,7 @@ _pq_fetch_tuples(cursorObject *curs) /* 4,5/ scale and precision */ if (ftype == NUMERICOID) { PyTuple_SET_ITEM(dtitem, 4, PyInt_FromLong((fmod >> 16) & 0xFFFF)); - PyTuple_SET_ITEM(dtitem, 5, PyInt_FromLong(fmod & 0xFFFF) - 4); + PyTuple_SET_ITEM(dtitem, 5, PyInt_FromLong((fmod & 0xFFFF) - 4)); } else { Py_INCREF(Py_None);