# HG changeset patch # User Renato Cunha # Date 2010-07-02 19:21:42 # Node ID 36a6aeb679da723b707c815b0252fd06a160b7bc # Parent 09cb56b760b47f1b13b744a6846fcdf54721df4d 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. diff --git a/hgext/inotify/linux/_inotify.c b/hgext/inotify/linux/_inotify.c --- a/hgext/inotify/linux/_inotify.c +++ b/hgext/inotify/linux/_inotify.c @@ -327,7 +327,7 @@ static void event_dealloc(struct event * 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)