summaryrefslogtreecommitdiff
path: root/psycopg/lobject.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/lobject.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/lobject.h')
-rw-r--r--psycopg/lobject.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/psycopg/lobject.h b/psycopg/lobject.h
index 293f608..84fd3b5 100644
--- a/psycopg/lobject.h
+++ b/psycopg/lobject.h
@@ -77,13 +77,13 @@ HIDDEN int lobject_close(lobjectObject *self);
#define EXC_IF_LOBJ_LEVEL0(self) \
if (self->conn->isolation_level == 0) { \
- psyco_set_error(ProgrammingError, (PyObject*)self, \
+ psyco_set_error(ProgrammingError, NULL, \
"can't use a lobject outside of transactions", NULL, NULL); \
return NULL; \
}
#define EXC_IF_LOBJ_UNMARKED(self) \
if (self->conn->mark != self->mark) { \
- psyco_set_error(ProgrammingError, (PyObject*)self, \
+ psyco_set_error(ProgrammingError, NULL, \
"lobject isn't valid anymore", NULL, NULL); \
return NULL; \
}