Skip to content

Commit

Permalink
use long instead of int in Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Lotze committed May 18, 2016
1 parent fee996e commit cb39aa2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/DocumentTemplate/cDocumentTemplate.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,10 @@ MM_has_key(MM *self, PyObject *args)
if ((key=MM_cget(self, key, 0)))
{
Py_DECREF(key);
return PyInt_FromLong(1);
return PyLong_FromLong(1);
}
PyErr_Clear();
return PyInt_FromLong(0);
return PyLong_FromLong(0);
}

static struct PyMethodDef MM_methods[] = {
Expand Down Expand Up @@ -446,7 +446,7 @@ MM_getattro(MM *self, PyObject *name)
if (PyString_Check(name))
{
if (strcmp(PyString_AsString(name),"level")==0)
return PyInt_FromLong(self->level);
return PyLong_FromLong(self->level);
}

if (self->dict)
Expand All @@ -470,7 +470,7 @@ MM_setattro(MM *self, PyObject *name, PyObject *v)
{
if (strcmp(PyString_AsString(name),"level")==0)
{
self->level=PyInt_AsLong(v);
self->level=PyLong_AsLong(v);
if (PyErr_Occurred()) return -1;
return 0;
}
Expand Down Expand Up @@ -894,9 +894,9 @@ safe_callable(PyObject *self, PyObject *args)
UNLESS(PyArg_ParseTuple(args,"O", &ob)) return NULL;
res = safe_PyCallable_Check(ob);
if (res)
return PyInt_FromLong(1);
return PyLong_FromLong(1);
else
return PyInt_FromLong(0);
return PyLong_FromLong(0);
}

static PyObject *
Expand Down

0 comments on commit cb39aa2

Please sign in to comment.