From 31f60be000a16c464217c260296a088e6dc020ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Urba=C5=84ski?= Date: Wed, 31 Mar 2010 02:00:27 +0200 Subject: [PATCH] Be a bit more explicit --- psycopg/connection_type.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/psycopg/connection_type.c b/psycopg/connection_type.c index efbe9e62..8e6758ac 100644 --- a/psycopg/connection_type.c +++ b/psycopg/connection_type.c @@ -74,8 +74,8 @@ psyco_conn_cursor(connectionObject *self, PyObject *args, PyObject *keywds) return NULL; } - if (name != NULL && self->async) { - PyErr_SetString(OperationalError, + if (name != NULL && self->async == 1) { + PyErr_SetString(ProgrammingError, "asynchronous connections " "cannot produce named cursors"); return NULL;