summaryrefslogtreecommitdiff
path: root/python/rpmfd-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/rpmfd-py.c
parent2f5a5c44cf5cd5406b153ba9ba37a7a5a4f4c6db (diff)
downloadrpm-4b8e0ebde64321a8dbcbdce9f44557185fde1719.tar.gz
rpm-4b8e0ebde64321a8dbcbdce9f44557185fde1719.tar.bz2
rpm-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/rpmfd-py.c')
-rw-r--r--python/rpmfd-py.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/python/rpmfd-py.c b/python/rpmfd-py.c
index 193d8e87f..62ddeb09e 100644
--- a/python/rpmfd-py.c
+++ b/python/rpmfd-py.c
@@ -285,8 +285,7 @@ static PyGetSetDef rpmfd_getseters[] = {
};
PyTypeObject rpmfd_Type = {
- PyObject_HEAD_INIT(&PyType_Type)
- 0, /* ob_size */
+ PyVarObject_HEAD_INIT(&PyType_Type, 0)
"rpm.fd", /* tp_name */
sizeof(rpmfdObject), /* tp_size */
0, /* tp_itemsize */