Mercurial > hg
changeset 11547:36a6aeb679da
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.
author | Renato Cunha <renatoc@gmail.com> |
---|---|
date | Fri, 02 Jul 2010 16:21:42 -0300 |
parents | 09cb56b760b4 |
children | dd2f356e1f6f |
files | hgext/inotify/linux/_inotify.c |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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)