~psycopg/psycopg/2.0.x

« back to all changes in this revision

Viewing changes to psycopg/cursor.h

  • Committer: Federico Di Gregorio
  • Date: 2004-12-10 10:34:57 UTC
  • Revision ID: fog-1b2e9ebeaa5d76bd7e4a9dc5eb779afb4076f236
async fixes and better connection/cursor management.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
extern void curs_reset(cursorObject *self);
73
73
    
74
74
/* exception-raising macros */
75
 
#define EXC_IF_CURS_CLOSED(self) if ((self)->closed) { \
76
 
    PyErr_SetString(InterfaceError, "cursor already closed"); \
 
75
#define EXC_IF_CURS_CLOSED(self) \
 
76
if ((self)->closed || ((self)->conn && (self)->conn->closed)) { \
 
77
    PyErr_SetString(InterfaceError, "cursor already closed");   \
77
78
    return NULL; }
78
79
 
79
 
#define EXC_IF_NO_TUPLES(self) if ((self)->notuples) { \
 
80
#define EXC_IF_NO_TUPLES(self) if ((self)->notuples) {        \
80
81
    PyErr_SetString(ProgrammingError, "no results to fetch"); \
81
82
    return NULL; }
82
83