Fixed parameters parsing in the connection constructor.

Keyword arguments were silently discarded.
This commit is contained in:
Daniele Varrazzo 2010-04-11 00:30:54 +01:00
parent 47ff5a6b01
commit 88fe5f91d2

View File

@ -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);