From bd5b76d0e41699ddaeb3c3b2ca6610600d311188 Mon Sep 17 00:00:00 2001 From: Federico Di Gregorio Date: Sat, 29 Jan 2005 04:19:39 +0000 Subject: [PATCH] The Andrea's-bunch-o-fixes (2). --- psycopg/cursor_type.c | 3 ++- psycopg/pqpath.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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);