2
0
Эх сурвалжийг харах

_diff_tree.c: fix Py_SIZE implementation for python 2.5.x users

Neither the Py_Size nor Py_SIZE macros are implemented in python 2.5.x,
so the current implementation (aliasing Py_SIZE to Py_Size) does not
work. Simply provide the 2.6 implementation here for python 2.5.x
users.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Tay Ray Chuan 14 жил өмнө
parent
commit
d3eebff93e
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      dulwich/_diff_tree.c

+ 1 - 1
dulwich/_diff_tree.c

@@ -25,7 +25,7 @@ typedef int Py_ssize_t;
 #endif
 
 #if (PY_VERSION_HEX < 0x02060000)
-#define Py_SIZE(x) Py_Size(x)
+#define Py_SIZE(ob)             (((PyVarObject*)(ob))->ob_size)
 #endif
 
 static PyObject *tree_entry_cls = NULL, *null_entry = NULL,