inotify: make proper use of Python API to get object size.
In older python versions, it was ok to access an object's type by accessing its
ob_type "member". With python 2.6+, the proper way of accessing it is via
Py_TYPE(object). This patch implements the correct call for the inotify
extension. When under python < 2.6, this macro is defined in mercurial's
util.h.
--- a/hgext/inotify/linux/_inotify.c Fri Jul 02 16:21:40 2010 -0300
+++ b/hgext/inotify/linux/_inotify.c Fri Jul 02 16:21:42 2010 -0300
@@ -327,7 +327,7 @@
Py_XDECREF(evt->cookie);
Py_XDECREF(evt->name);
- (*evt->ob_type->tp_free)(evt);
+ Py_TYPE(evt)->tp_free(evt);
}
static PyObject *event_repr(struct event *evt)