summaryrefslogtreecommitdiff
path: root/python/rpmfd-py.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2009-10-15 15:14:56 -0400
committerPanu Matilainen <pmatilai@redhat.com>2009-10-19 10:50:24 +0300
commit7b51c4a1eb8f14207f9a8d3e0be514a41c0e2197 (patch)
tree0ae6fd661d3c7a2142a1e3675b10c7f2c29588af /python/rpmfd-py.c
parent63175d4d31469816c575ddb4de9698fb5c053536 (diff)
downloadlibrpm-tizen-7b51c4a1eb8f14207f9a8d3e0be514a41c0e2197.tar.gz
librpm-tizen-7b51c4a1eb8f14207f9a8d3e0be514a41c0e2197.tar.bz2
librpm-tizen-7b51c4a1eb8f14207f9a8d3e0be514a41c0e2197.zip
Generalize access to ob_type so that they work with both Python 2.* and Python 3.*
Python 2's various object structs use macros to implement common fields at the top of each struct. Python 3's objects instead embed a PyObject struct as the first member within the more refined object structs. Use the Py_TYPE() macro when accessing ob_type in order to encapsulate this difference.
Diffstat (limited to 'python/rpmfd-py.c')
-rw-r--r--python/rpmfd-py.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/rpmfd-py.c b/python/rpmfd-py.c
index 077cf9e1f..193d8e87f 100644
--- a/python/rpmfd-py.c
+++ b/python/rpmfd-py.c
@@ -107,7 +107,7 @@ static void rpmfd_dealloc(rpmfdObject *s)
{
PyObject *res = do_close(s);
Py_XDECREF(res);
- s->ob_type->tp_free((PyObject *)s);
+ Py_TYPE(s)->tp_free((PyObject *)s);
}
static PyObject *rpmfd_fileno(rpmfdObject *s)