Преглед на файлове

Check for PyLong, for pypy.

Jelmer Vernooij преди 9 години
родител
ревизия
65adf6bb76
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      dulwich/_objects.c

+ 2 - 2
dulwich/_objects.c

@@ -199,7 +199,7 @@ static PyObject *py_sorted_tree_items(PyObject *self, PyObject *args)
 		}
 
 		py_mode = PyTuple_GET_ITEM(value, 0);
-		if (!PyInt_Check(py_mode)) {
+		if (!PyInt_Check(py_mode) && !PyLong_Check(py_mode)) {
 			PyErr_SetString(PyExc_TypeError, "Mode is not an integral type");
 			goto error;
 		}
@@ -210,7 +210,7 @@ static PyObject *py_sorted_tree_items(PyObject *self, PyObject *args)
 			goto error;
 		}
 		qsort_entries[n].name = PyString_AS_STRING(key);
-		qsort_entries[n].mode = PyInt_AS_LONG(py_mode);
+		qsort_entries[n].mode = PyInt_AsLong(py_mode);
 
 		qsort_entries[n].tuple = PyObject_CallFunctionObjArgs(
 		                tree_entry_cls, key, py_mode, py_sha, NULL);