summaryrefslogtreecommitdiff
path: root/psycopg/cursor.h
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-02-20 23:43:25 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2011-02-21 00:31:09 +0000
commitbeffb02d564df8684137a5678d2a0a946e2a42d7 (patch)
tree847422cbe4ec2540c2f8f9ba65448b1d7120c9d8 /psycopg/cursor.h
parenta97e2a842df6f81b544e23b0f9db78cd07c86e8d (diff)
downloadpsycopg2-beffb02d564df8684137a5678d2a0a946e2a42d7.tar.gz
Stricter declaration and correct use of psyco_set_error
It has long been used in wrong ways, with the function receiving a connection or lobject instead of a cursor. It has always been unnoticed (nobody has noticed the wrong object attached to the exception in the wrong cases) but it started crashing the interpreter with Python 3.2 on Windows. Thanks to Jason Erickson for finding the problem and helping fixing it.
Diffstat (limited to 'psycopg/cursor.h')
-rw-r--r--psycopg/cursor.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/psycopg/cursor.h b/psycopg/cursor.h
index 395c561..09ac12a 100644
--- a/psycopg/cursor.h
+++ b/psycopg/cursor.h
@@ -34,7 +34,8 @@ extern "C" {
extern HIDDEN PyTypeObject cursorType;
-typedef struct {
+/* the typedef is forward-declared in psycopg.h */
+struct cursorObject {
PyObject_HEAD
connectionObject *conn; /* connection owning the cursor */
@@ -79,7 +80,8 @@ typedef struct {
PyObject *weakreflist; /* list of weak references */
-} cursorObject;
+};
+
/* C-callable functions in cursor_int.c and cursor_ext.c */
HIDDEN PyObject *curs_get_cast(cursorObject *self, PyObject *oid);