Commit a20f0a72 authored by Tres Seaver's avatar Tres Seaver

Unhork argument passing between cPersistent and _timestamp under Py3k.

parent db732a81
...@@ -462,7 +462,11 @@ TimeStamp_TimeStamp(PyObject *obj, PyObject *args) ...@@ -462,7 +462,11 @@ TimeStamp_TimeStamp(PyObject *obj, PyObject *args)
int len = 0, y, mo, d, h = 0, m = 0; int len = 0, y, mo, d, h = 0, m = 0;
double sec = 0; double sec = 0;
if (PyArg_ParseTuple(args, "s#:TimeStamp", &buf, &len)) #ifdef PY3K
if (PyArg_ParseTuple(args, "y#", &buf, &len))
#else
if (PyArg_ParseTuple(args, "s#", &buf, &len))
#endif
{ {
if (len != 8) if (len != 8)
{ {
......
...@@ -1100,9 +1100,15 @@ Per_get_mtime(cPersistentObject *self) ...@@ -1100,9 +1100,15 @@ Per_get_mtime(cPersistentObject *self)
return Py_None; return Py_None;
} }
#ifdef PY3K
t = PyObject_CallFunction(TimeStamp, "y#", self->serial, 8);
#else
t = PyObject_CallFunction(TimeStamp, "s#", self->serial, 8); t = PyObject_CallFunction(TimeStamp, "s#", self->serial, 8);
#endif
if (!t) if (!t)
{
return NULL; return NULL;
}
v = PyObject_CallMethod(t, "timeTime", ""); v = PyObject_CallMethod(t, "timeTime", "");
Py_DECREF(t); Py_DECREF(t);
return v; return v;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment