diff options
author | David Malcolm <dmalcolm@redhat.com> | 2009-10-15 15:14:57 -0400 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-10-19 11:02:13 +0300 |
commit | 4b8e0ebde64321a8dbcbdce9f44557185fde1719 (patch) | |
tree | a9ca525d8beca19b15f69bc1cf88974578a57f78 /python/rpmds-py.c | |
parent | 2f5a5c44cf5cd5406b153ba9ba37a7a5a4f4c6db (diff) | |
download | librpm-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/rpmds-py.c')
-rw-r--r-- | python/rpmds-py.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/python/rpmds-py.c b/python/rpmds-py.c index 8938cc7a1..f45c908ce 100644 --- a/python/rpmds-py.c +++ b/python/rpmds-py.c @@ -452,8 +452,7 @@ static char rpmds_doc[] = ""; PyTypeObject rpmds_Type = { - PyObject_HEAD_INIT(&PyType_Type) - 0, /* ob_size */ + PyVarObject_HEAD_INIT(&PyType_Type, 0) "rpm.ds", /* tp_name */ sizeof(rpmdsObject), /* tp_basicsize */ 0, /* tp_itemsize */ |