Fix backward compatibility for set_multi timeout.

Fixes #13 HOH
int
lericson 2010-05-27 21:53:33 +02:00
parent 02c7681ff2
commit 86f6256d3a
2 changed files with 10 additions and 6 deletions

View File

@ -453,12 +453,12 @@ static PyObject *_PylibMC_RunSetCommandMulti(PylibMC_Client* self,
PyObject * retval = NULL;
size_t idx = 0;
static char *kws[] = { "keys", "key_prefix", "time", "min_compress_len", NULL };
static char *kws[] = { "keys", "time", "key_prefix", "min_compress_len", NULL };
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|O!II", kws,
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|ISI", kws,
&PyDict_Type, &keys,
&PyString_Type, &key_prefix,
&time, &min_compress)) {
&time, &key_prefix,
&min_compress)) {
return NULL;
}

View File

@ -74,11 +74,15 @@ True
>>> c.get("hi")
>>> c.set("hi", "loretta", int(time()) + 2)
True
>>> c.set_multi({"hi2": "charlotta"}, 1)
[]
>>> c.get("hi")
'loretta'
>>> c.get("hi2")
'charlotta'
>>> sleep(3.1)
>>> c.get("hi")
>>>
>>> c.get("hi"), c.get("hi2")
(None, None)
See issue #1 ``http://github.com/lericson/pylibmc/issues/#issue/1`` -- delete
should not accept a time argument.