diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-04-11 00:30:54 +0100 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-04-11 00:30:54 +0100 |
commit | 88fe5f91d2834a50ab98afbff653a424ea132c8e (patch) | |
tree | 2d22157add3d06f0cb314cb01f0caa1b7adf98ef | |
parent | 47ff5a6b012564a9d731a7801417c1062cd69cf5 (diff) | |
download | psycopg2-88fe5f91d2834a50ab98afbff653a424ea132c8e.tar.gz |
Fixed parameters parsing in the connection constructor.
Keyword arguments were silently discarded.
-rw-r--r-- | psycopg/connection_type.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/psycopg/connection_type.c b/psycopg/connection_type.c index 8e6758a..3fd08a4 100644 --- a/psycopg/connection_type.c +++ b/psycopg/connection_type.c @@ -757,8 +757,9 @@ connection_init(PyObject *obj, PyObject *args, PyObject *kwds) { const char *dsn; long int async = 0; + static char *kwlist[] = {"dsn", "async", NULL}; - if (!PyArg_ParseTuple(args, "s|l", &dsn, &async)) + if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|l", kwlist, &dsn, &async)) return -1; return connection_setup((connectionObject *)obj, dsn, async); |