summaryrefslogtreecommitdiff
path: root/psycopg/psycopgmodule.c
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-02-03 04:45:17 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-02-03 04:45:17 +0000
commit1911b250e33e140bbbc25f3536bda24e8ca35bdb (patch)
treec18202b036fb5e5570c3556e852efae9a4dee76e /psycopg/psycopgmodule.c
parent6e89db020ca9fd93260bfff7aadef64dd4535553 (diff)
parent44c3b776917444ca98667f5d6f4470c767f820bf (diff)
downloadpsycopg2-1911b250e33e140bbbc25f3536bda24e8ca35bdb.tar.gz
Merge branch 'async-keyword'
Close #495
Diffstat (limited to 'psycopg/psycopgmodule.c')
-rw-r--r--psycopg/psycopgmodule.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/psycopg/psycopgmodule.c b/psycopg/psycopgmodule.c
index c4d1517..6c95bd6 100644
--- a/psycopg/psycopgmodule.c
+++ b/psycopg/psycopgmodule.c
@@ -82,15 +82,17 @@ psyco_connect(PyObject *self, PyObject *args, PyObject *keywds)
PyObject *conn = NULL;
PyObject *factory = NULL;
const char *dsn = NULL;
- int async = 0;
+ int async = 0, async_ = 0;
- static char *kwlist[] = {"dsn", "connection_factory", "async", NULL};
+ static char *kwlist[] = {"dsn", "connection_factory", "async", "async_", NULL};
- if (!PyArg_ParseTupleAndKeywords(args, keywds, "s|Oi", kwlist,
- &dsn, &factory, &async)) {
+ if (!PyArg_ParseTupleAndKeywords(args, keywds, "s|Oii", kwlist,
+ &dsn, &factory, &async, &async_)) {
return NULL;
}
+ if (async_) { async = async_; }
+
Dprintf("psyco_connect: dsn = '%s', async = %d", dsn, async);
/* allocate connection, fill with errors and return it */