diff options
| author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-04-21 12:42:25 +0100 |
|---|---|---|
| committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-04-21 15:21:33 +0100 |
| commit | 8fed0aa57d588c3655423a3d25ece01662719836 (patch) | |
| tree | d5c6ec1c41a7eb04dff6a483faf09d7c4a128f27 /psycopg/cursor.h | |
| parent | c1f0d4d46cb1f177e5966ed2d8bba413410ec424 (diff) | |
| download | psycopg2-8fed0aa57d588c3655423a3d25ece01662719836.tar.gz | |
Forbid COPY-related methods in green mode.
With the current implementation, at best they would silently block. They
actually hang everything.
Implementation posponed after some refactoring of the polling system,
because it will be probably possible to provide an implementation for
'poll()' during COPY which is good for both async and green modes.
Diffstat (limited to 'psycopg/cursor.h')
| -rw-r--r-- | psycopg/cursor.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/psycopg/cursor.h b/psycopg/cursor.h index 68a087a..613ed9d 100644 --- a/psycopg/cursor.h +++ b/psycopg/cursor.h @@ -116,6 +116,12 @@ if ((self)->conn->async_cursor != NULL) { \ "while an asynchronous query is underway"); \ return NULL; } +#define EXC_IF_GREEN(cmd) \ +if (psyco_green()) { \ + PyErr_SetString(PyExc_NotImplementedError, #cmd " cannot be used " \ + "with an asynchronous callback (yet)."); \ + return NULL; } + #ifdef __cplusplus } #endif |
