summaryrefslogtreecommitdiff
path: root/python/rpmmi-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/rpmmi-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/rpmmi-py.c')
-rw-r--r--python/rpmmi-py.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/rpmmi-py.c b/python/rpmmi-py.c
index b3cd6d2ab..0a871534d 100644
--- a/python/rpmmi-py.c
+++ b/python/rpmmi-py.c
@@ -129,7 +129,7 @@ static void rpmmi_dealloc(rpmmiObject * s)
{
s->mi = rpmdbFreeIterator(s->mi);
Py_DECREF(s->ref);
- s->ob_type->tp_free((PyObject *)s);
+ Py_TYPE(s)->tp_free((PyObject *)s);
}
static Py_ssize_t rpmmi_length(rpmmiObject * s)