summaryrefslogtreecommitdiff
path: root/python/rpmmi-py.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2009-10-15 15:14:57 -0400
committerPanu Matilainen <pmatilai@redhat.com>2009-10-19 11:02:13 +0300
commit4b8e0ebde64321a8dbcbdce9f44557185fde1719 (patch)
treea9ca525d8beca19b15f69bc1cf88974578a57f78 /python/rpmmi-py.c
parent2f5a5c44cf5cd5406b153ba9ba37a7a5a4f4c6db (diff)
downloadlibrpm-tizen-4b8e0ebde64321a8dbcbdce9f44557185fde1719.tar.gz
librpm-tizen-4b8e0ebde64321a8dbcbdce9f44557185fde1719.tar.bz2
librpm-tizen-4b8e0ebde64321a8dbcbdce9f44557185fde1719.zip
Generalize type object initialization to work with both Python 2.* and Python 3.*
The layout of PyVarObject changed between python 2 and python 3, and this leads to the existing code for all of the various PyTypeObject initializers failing to compile with python 3 Change the way we initialize these structs to use PyVarObject_HEAD_INIT directly, rather than merely PyObject_HEAD_INIT, so that it compiles cleanly with both major versions of Python
Diffstat (limited to 'python/rpmmi-py.c')
-rw-r--r--python/rpmmi-py.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/python/rpmmi-py.c b/python/rpmmi-py.c
index 0a871534d..f6dd80271 100644
--- a/python/rpmmi-py.c
+++ b/python/rpmmi-py.c
@@ -146,8 +146,7 @@ static char rpmmi_doc[] =
"";
PyTypeObject rpmmi_Type = {
- PyObject_HEAD_INIT(&PyType_Type)
- 0, /* ob_size */
+ PyVarObject_HEAD_INIT(&PyType_Type, 0)
"rpm.mi", /* tp_name */
sizeof(rpmmiObject), /* tp_size */
0, /* tp_itemsize */