--- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/abstract.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/abstract.c @@ -54,7 +54,7 @@ if (!vl_obj) return 0; - return PyInt_AsLong(vl_obj); + return PyLong_AsLong(vl_obj); } dbus_bool_t @@ -76,7 +76,7 @@ } } else { - PyObject *vl_obj = PyInt_FromLong(variant_level); + PyObject *vl_obj = PyLong_FromLong(variant_level); if (!vl_obj) { Py_DECREF(key); return FALSE; @@ -127,7 +127,7 @@ Py_DECREF(key); if (!value) - return PyInt_FromLong(0); + return PyLong_FromLong(0); Py_INCREF(value); return value; } @@ -184,7 +184,7 @@ return NULL; } - self = (PyInt_Type.tp_new)(cls, args, NULL); + self = (PyLong_Type.tp_new)(cls, args, NULL); if (self) { ((DBusPyIntBase *)self)->variant_level = variantness; } @@ -194,7 +194,7 @@ static PyObject * DBusPythonInt_tp_repr(PyObject *self) { - PyObject *parent_repr = (PyInt_Type.tp_repr)(self); + PyObject *parent_repr = (PyLong_Type.tp_repr)(self); long variant_level = ((DBusPyIntBase *)self)->variant_level; PyObject *my_repr; @@ -215,8 +215,7 @@ } PyTypeObject DBusPyIntBase_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "_dbus_bindings._IntBase", sizeof(DBusPyIntBase), 0, @@ -327,8 +326,7 @@ } PyTypeObject DBusPyFloatBase_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "_dbus_bindings._FloatBase", sizeof(DBusPyFloatBase), 0, @@ -420,7 +418,7 @@ Py_DECREF(parent_repr); return NULL; } - variant_level = PyInt_AsLong(vl_obj); + variant_level = PyLong_AsLong(vl_obj); Py_DECREF(vl_obj); if (variant_level > 0) { my_repr = PyString_FromFormat("%s(%s, variant_level=%ld)", @@ -445,8 +443,7 @@ } PyTypeObject DBusPyStrBase_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "_dbus_bindings._StrBase", 0, 0, @@ -538,7 +535,7 @@ Py_DECREF(parent_repr); return NULL; } - variant_level = PyInt_AsLong(vl_obj); + variant_level = PyLong_AsLong(vl_obj); Py_DECREF(vl_obj); if (variant_level) { my_repr = PyString_FromFormat("%s(%s, variant_level=%ld)", @@ -563,8 +560,7 @@ } PyTypeObject DBusPyLongBase_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "_dbus_bindings._LongBase", 0, 0, @@ -623,7 +619,7 @@ dbus_py_signature_const = PyString_InternFromString("signature"); if (!dbus_py_signature_const) return 0; - DBusPyIntBase_Type.tp_base = &PyInt_Type; + DBusPyIntBase_Type.tp_base = &PyLong_Type; if (PyType_Ready(&DBusPyIntBase_Type) < 0) return 0; /* disable the tp_print copied from PyInt_Type, so tp_repr gets called as desired */ --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/bus.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/bus.c @@ -62,7 +62,7 @@ return (PyObject *)self; } - else if (!first || PyInt_Check(first)) { + else if (!first || PyLong_Check(first)) { long type; PyObject *libdbusconn; PyObject *new_args; @@ -73,7 +73,7 @@ DBUS_BUS_SESSION. */ if (first) { - type = PyInt_AsLong(first); + type = PyLong_AsLong(first); if (type != DBUS_BUS_SESSION && type != DBUS_BUS_SYSTEM && type != DBUS_BUS_STARTER) { --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/bytes.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/bytes.c @@ -84,10 +84,10 @@ if (PyString_GET_SIZE(obj) != 1) { goto bad_arg; } - obj = PyInt_FromLong((unsigned char)(PyString_AS_STRING(obj)[0])); - } - else if (PyInt_Check(obj)) { - long i = PyInt_AS_LONG(obj); + obj = PyLong_FromLong((unsigned char)(PyString_AS_STRING(obj)[0])); + } + else if (PyLong_Check(obj)) { + long i = PyLong_AS_LONG(obj); if (obj->ob_type == cls && ((DBusPyIntBase *)obj)->variant_level == variantness) { @@ -124,13 +124,12 @@ static PyObject * Byte_tp_str(PyObject *self) { - unsigned char str[2] = { (unsigned char)PyInt_AS_LONG(self), 0 }; + unsigned char str[2] = { (unsigned char)PyLong_AS_LONG(self), 0 }; return PyString_FromStringAndSize((char *)str, 1); } PyTypeObject DBusPyByte_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.Byte", 0, 0, @@ -196,8 +195,7 @@ ); PyTypeObject DBusPyByteArray_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.ByteArray", 0, 0, --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/conn.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/conn.c @@ -99,7 +99,7 @@ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } else { - long i = PyInt_AsLong(obj); + long i = PyLong_AsLong(obj); DBG("%p: handler %p returned %ld", conn, callable, i); Py_DECREF(obj); if (i == -1 && PyErr_Occurred()) { @@ -389,14 +389,13 @@ DBG("Connection at %p: freeing self", self); PyErr_Restore(et, ev, etb); - (self->ob_type->tp_free)((PyObject *)self); + (Py_TYPE(self)->tp_free)((PyObject *)self); } /* Connection type object =========================================== */ PyTypeObject DBusPyConnection_Type = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ + PyVarObject_HEAD_INIT(NULL, 0) /*ob_size*/ "_dbus_bindings.Connection", /*tp_name*/ sizeof(Connection), /*tp_basicsize*/ 0, /*tp_itemsize*/ --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/containers.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/containers.c @@ -95,14 +95,14 @@ if (variant_level > 0) { my_repr = PyString_FromFormat("%s(%s, signature=%s, " "variant_level=%ld)", - self->super.ob_type->tp_name, + Py_TYPE(self)->tp_name, PyString_AS_STRING(parent_repr), PyString_AS_STRING(sig_repr), variant_level); } else { my_repr = PyString_FromFormat("%s(%s, signature=%s)", - self->super.ob_type->tp_name, + Py_TYPE(self)->tp_name, PyString_AS_STRING(parent_repr), PyString_AS_STRING(sig_repr)); } @@ -128,7 +128,7 @@ variant_level = PyDict_GetItem(kwargs, dbus_py_variant_level_const); } if (variant_level) { - self->variant_level = PyInt_AsLong(variant_level); + self->variant_level = PyLong_AsLong(variant_level); if (PyErr_Occurred()) { Py_DECREF((PyObject *)self); return NULL; @@ -196,8 +196,7 @@ } PyTypeObject DBusPyArray_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.Array", sizeof(DBusPyArray), 0, @@ -304,14 +303,14 @@ if (variant_level > 0) { my_repr = PyString_FromFormat("%s(%s, signature=%s, " "variant_level=%ld)", - self->super.ob_type->tp_name, + Py_TYPE(self)->tp_name, PyString_AS_STRING(parent_repr), PyString_AS_STRING(sig_repr), variant_level); } else { my_repr = PyString_FromFormat("%s(%s, signature=%s)", - self->super.ob_type->tp_name, + Py_TYPE(self)->tp_name, PyString_AS_STRING(parent_repr), PyString_AS_STRING(sig_repr)); } @@ -337,7 +336,7 @@ variant_level = PyDict_GetItem(kwargs, dbus_py_variant_level_const); } if (variant_level) { - self->variant_level = PyInt_AsLong(variant_level); + self->variant_level = PyLong_AsLong(variant_level); if (PyErr_Occurred()) { Py_DECREF((PyObject *)self); return NULL; @@ -430,8 +429,7 @@ } PyTypeObject DBusPyDict_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.Dictionary", sizeof(DBusPyDict), 0, @@ -685,8 +683,7 @@ } PyTypeObject DBusPyStruct_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.Struct", 0, 0, --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/float.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/float.c @@ -40,8 +40,7 @@ #endif PyTypeObject DBusPyDouble_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.Double", 0, 0, @@ -84,8 +83,7 @@ #ifdef WITH_DBUS_FLOAT32 PyTypeObject DBusPyFloat_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.Float", 0, 0, --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/generic.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/generic.c @@ -38,9 +38,9 @@ { if (op == Py_EQ || op == Py_NE) { if (self == other) { - return PyInt_FromLong(op == Py_EQ); + return PyLong_FromLong(op == Py_EQ); } - return PyInt_FromLong(op == Py_NE); + return PyLong_FromLong(op == Py_NE); } PyErr_SetString(PyExc_TypeError, "Instances of this type are not ordered"); --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/int.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/int.c @@ -77,17 +77,16 @@ if (variant_level > 0) { return PyString_FromFormat("%s(%s, variant_level=%ld)", self->ob_type->tp_name, - PyInt_AsLong(self) ? "True" : "False", + PyLong_AsLong(self) ? "True" : "False", variant_level); } return PyString_FromFormat("%s(%s)", self->ob_type->tp_name, - PyInt_AsLong(self) ? "True" : "False"); + PyLong_AsLong(self) ? "True" : "False"); } PyTypeObject DBusPyBoolean_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.Boolean", 0, 0, @@ -153,7 +152,7 @@ dbus_int16_t dbus_py_int16_range_check(PyObject *obj) { - long i = PyInt_AsLong (obj); + long i = PyLong_AsLong(obj); if (i == -1 && PyErr_Occurred ()) return -1; if (i < -0x8000 || i > 0x7fff) { PyErr_Format(PyExc_OverflowError, "Value %d out of range for Int16", @@ -175,8 +174,7 @@ } PyTypeObject DBusPyInt16_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.Int16", 0, 0, @@ -242,7 +240,7 @@ dbus_uint16_t dbus_py_uint16_range_check(PyObject *obj) { - long i = PyInt_AsLong(obj); + long i = PyLong_AsLong(obj); if (i == -1 && PyErr_Occurred()) return (dbus_uint16_t)(-1); if (i < 0 || i > 0xffff) { PyErr_Format(PyExc_OverflowError, "Value %d out of range for UInt16", @@ -265,8 +263,7 @@ } PyTypeObject DBusPyUInt16_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.UInt16", 0, 0, @@ -332,7 +329,7 @@ dbus_int32_t dbus_py_int32_range_check(PyObject *obj) { - long i = PyInt_AsLong(obj); + long i = PyLong_AsLong(obj); if (i == -1 && PyErr_Occurred()) return -1; if (i < INT32_MIN || i > INT32_MAX) { PyErr_Format(PyExc_OverflowError, "Value %d out of range for Int32", @@ -354,8 +351,7 @@ } PyTypeObject DBusPyInt32_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.Int32", 0, 0, @@ -456,8 +452,7 @@ } PyTypeObject DBusPyUInt32_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.UInt32", 0, 0, @@ -567,8 +562,7 @@ } PyTypeObject DBusPyInt64_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.Int64", 0, 0, @@ -674,8 +668,7 @@ } PyTypeObject DBusPyUInt64_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.UInt64", 0, 0, --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/libdbusconn.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/libdbusconn.c @@ -73,12 +73,11 @@ } PyErr_Restore(et, ev, etb); - (self->ob_type->tp_free)((PyObject *) self); + (Py_TYPE(self)->tp_free)((PyObject *) self); } PyTypeObject DBusPyLibDBusConnection_Type = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ + PyVarObject_HEAD_INIT(NULL, 0) /*ob_size*/ "_dbus_bindings._LibDBusConnection", sizeof(DBusPyLibDBusConnection), 0, /*tp_itemsize*/ --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/mainloop.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/mainloop.c @@ -59,8 +59,7 @@ } static PyTypeObject NativeMainLoop_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.mainloop.NativeMainLoop", sizeof(NativeMainLoop), 0, --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/message-append.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/message-append.c @@ -188,7 +188,7 @@ Py_DECREF(magic_attr); /* Ordering is important: some of these are subclasses of each other. */ - if (PyInt_Check(obj)) { + if (PyLong_Check(obj)) { if (DBusPyInt16_Check(obj)) return PyString_FromString(DBUS_TYPE_INT16_AS_STRING); else if (DBusPyInt32_Check(obj)) @@ -499,7 +499,7 @@ y = *(unsigned char *)PyString_AS_STRING(obj); } else { - long i = PyInt_AsLong(obj); + long i = PyLong_AsLong(obj); if (i == -1 && PyErr_Occurred()) return -1; if (i < 0 || i > 0xff) { --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/message.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/message.c @@ -53,7 +53,7 @@ if (self->msg) { dbus_message_unref(self->msg); } - self->ob_type->tp_free((PyObject *)self); + Py_TYPE(self)->tp_free((PyObject *)self); } static PyObject * @@ -810,8 +810,7 @@ }; static PyTypeObject MessageType = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ + PyVarObject_HEAD_INIT(NULL, 0) /*ob_size*/ "dbus.lowlevel.Message", /*tp_name*/ sizeof(Message), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -852,8 +851,7 @@ }; static PyTypeObject MethodCallMessageType = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ + PyVarObject_HEAD_INIT(NULL, 0) /*ob_size*/ "dbus.lowlevel.MethodCallMessage", /*tp_name*/ 0, /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -894,8 +892,7 @@ }; static PyTypeObject MethodReturnMessageType = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ + PyVarObject_HEAD_INIT(NULL, 0) /*ob_size*/ "dbus.lowlevel.MethodReturnMessage", /*tp_name*/ 0, /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -936,8 +933,7 @@ }; static PyTypeObject SignalMessageType = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ + PyVarObject_HEAD_INIT(NULL, 0) /*ob_size*/ "dbus.lowlevel.SignalMessage", /*tp_name*/ 0, /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -978,8 +974,7 @@ }; static PyTypeObject ErrorMessageType = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ + PyVarObject_HEAD_INIT(NULL, 0) /*ob_size*/ "dbus.lowlevel.ErrorMessage", /*tp_name*/ 0, /*tp_basicsize*/ 0, /*tp_itemsize*/ --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/module.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/module.c @@ -233,6 +233,22 @@ {NULL, NULL, 0, NULL} }; +#if PY_MAJOR_VERSION >= 3 +static struct PyModuleDef moduledef = { + PyModuleDef_HEAD_INIT, + "_dbus_bindings",/* m_name */ + module_doc,/* m_doc */ + 0,/* m_size */ + module_functions,/* m_methods */ + NULL,/* m_reload */ + NULL,/* m_traverse */ + NULL,/* m_clear */ + NULL,/* m_free */ +}; +#define MOD_ERROR_VAL NULL +#else +#endif + PyMODINIT_FUNC init_dbus_bindings(void) { @@ -256,63 +272,184 @@ PyEval_InitThreads(); } - if (!dbus_py_init_generic()) return; - if (!dbus_py_init_abstract()) return; - if (!dbus_py_init_signature()) return; - if (!dbus_py_init_int_types()) return; - if (!dbus_py_init_string_types()) return; - if (!dbus_py_init_float_types()) return; - if (!dbus_py_init_container_types()) return; - if (!dbus_py_init_byte_types()) return; - if (!dbus_py_init_message_types()) return; - if (!dbus_py_init_pending_call()) return; - if (!dbus_py_init_mainloop()) return; - if (!dbus_py_init_libdbus_conn_types()) return; - if (!dbus_py_init_conn_types()) return; - if (!dbus_py_init_server_types()) return; - + if (!dbus_py_init_generic()) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_init_abstract()) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_init_signature()) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_init_int_types()) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_init_string_types()) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_init_float_types()) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_init_container_types()) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_init_byte_types()) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_init_message_types()) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_init_pending_call()) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_init_mainloop()) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_init_libdbus_conn_types()) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_init_conn_types()) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_init_server_types()) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + + this_module = PyModule_Create(&moduledef); + #else + this_module = Py_InitModule3("_dbus_bindings", module_functions, module_doc); - if (!this_module) return; - - if (!dbus_py_insert_abstract_types(this_module)) return; - if (!dbus_py_insert_signature(this_module)) return; - if (!dbus_py_insert_int_types(this_module)) return; - if (!dbus_py_insert_string_types(this_module)) return; - if (!dbus_py_insert_float_types(this_module)) return; - if (!dbus_py_insert_container_types(this_module)) return; - if (!dbus_py_insert_byte_types(this_module)) return; - if (!dbus_py_insert_message_types(this_module)) return; - if (!dbus_py_insert_pending_call(this_module)) return; - if (!dbus_py_insert_mainloop_types(this_module)) return; - if (!dbus_py_insert_libdbus_conn_types(this_module)) return; - if (!dbus_py_insert_conn_types(this_module)) return; - if (!dbus_py_insert_server_types(this_module)) return; + #endif + if (!this_module) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + + if (!dbus_py_insert_abstract_types(this_module)) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_insert_signature(this_module)) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_insert_int_types(this_module)) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_insert_string_types(this_module)) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_insert_float_types(this_module)) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_insert_container_types(this_module)) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_insert_byte_types(this_module)) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_insert_message_types(this_module)) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_insert_pending_call(this_module)) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_insert_mainloop_types(this_module)) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_insert_libdbus_conn_types(this_module)) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_insert_conn_types(this_module)) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + + if (!dbus_py_insert_server_types(this_module)) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + if (PyModule_AddStringConstant(this_module, "BUS_DAEMON_NAME", - DBUS_SERVICE_DBUS) < 0) return; + DBUS_SERVICE_DBUS) < 0) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + if (PyModule_AddStringConstant(this_module, "BUS_DAEMON_PATH", - DBUS_PATH_DBUS) < 0) return; + DBUS_PATH_DBUS) < 0) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + if (PyModule_AddStringConstant(this_module, "BUS_DAEMON_IFACE", - DBUS_INTERFACE_DBUS) < 0) return; + DBUS_INTERFACE_DBUS) < 0) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + if (PyModule_AddStringConstant(this_module, "LOCAL_PATH", - DBUS_PATH_LOCAL) < 0) return; + DBUS_PATH_LOCAL) < 0) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + if (PyModule_AddStringConstant(this_module, "LOCAL_IFACE", - DBUS_INTERFACE_LOCAL) < 0) return; + DBUS_INTERFACE_LOCAL) < 0) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + if (PyModule_AddStringConstant(this_module, "INTROSPECTABLE_IFACE", - DBUS_INTERFACE_INTROSPECTABLE) < 0) return; + DBUS_INTERFACE_INTROSPECTABLE) < 0) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + if (PyModule_AddStringConstant(this_module, "PEER_IFACE", - DBUS_INTERFACE_PEER) < 0) return; + DBUS_INTERFACE_PEER) < 0) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + if (PyModule_AddStringConstant(this_module, "PROPERTIES_IFACE", - DBUS_INTERFACE_PROPERTIES) < 0) return; + DBUS_INTERFACE_PROPERTIES) < 0) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + if (PyModule_AddStringConstant(this_module, "DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER", - DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER) < 0) return; + DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER) < 0) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + if (PyModule_AddStringConstant(this_module, "DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER", - DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER) < 0) return; + DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER) < 0) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + if (PyModule_AddStringConstant(this_module, "DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE", - DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE) < 0) return; + DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE) < 0) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + #define ADD_CONST_VAL(x, v) \ if (PyModule_AddIntConstant(this_module, x, v) < 0) return; @@ -379,19 +516,35 @@ ADD_CONST_PREFIXED(WATCH_ERROR) if (PyModule_AddStringConstant(this_module, "__docformat__", - "restructuredtext") < 0) return; + "restructuredtext") < 0) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + if (PyModule_AddStringConstant(this_module, "__version__", - PACKAGE_VERSION) < 0) return; + PACKAGE_VERSION) < 0) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + if (PyModule_AddIntConstant(this_module, "_python_version", - PY_VERSION_HEX) < 0) return; + PY_VERSION_HEX) < 0) #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + c_api = PyCObject_FromVoidPtr ((void *)dbus_bindings_API, NULL); if (!c_api) { - return; + #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + } PyModule_AddObject(this_module, "_C_API", c_api); + #if PY_MAJOR_VERSION >= 3 + return this_module; + #endif + } /* vim:set ft=c cino< sw=4 sts=4 et: */ --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/pending-call.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/pending-call.c @@ -233,8 +233,7 @@ }; static PyTypeObject PendingCallType = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.lowlevel.PendingCall", sizeof(PendingCall), 0, --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/server.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/server.c @@ -40,7 +40,7 @@ PyObject *weaklist; PyObject *mainloop; -} Server; +}Server; PyDoc_STRVAR(Server_tp_doc, "A D-Bus server.\n" @@ -429,7 +429,7 @@ DBG("Server at %p: freeing self", self); PyErr_Restore(et, ev, etb); - (self->ob_type->tp_free)((PyObject *)self); + (Py_TYPE(self)->tp_free)((PyObject *)self); } PyDoc_STRVAR(Server_disconnect__doc__, @@ -511,8 +511,7 @@ }; PyTypeObject DBusPyServer_Type = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ + PyVarObject_HEAD_INIT(NULL, 0) /*ob_size*/ "_dbus_bindings._Server",/*tp_name*/ sizeof(Server), /*tp_basicsize*/ 0, /*tp_itemsize*/ --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/signature.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/signature.c @@ -99,8 +99,7 @@ } static PyTypeObject SignatureIterType = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "_dbus_bindings._SignatureIter", sizeof(SignatureIter), 0, @@ -177,8 +176,7 @@ } PyTypeObject DBusPySignature_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.Signature", 0, 0, --- ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/string.c.orig +++ ../../python3/packaging/modules/by-hand/dbus-python/devel/dbus-python-0.83.0/_dbus_bindings/string.c @@ -82,8 +82,7 @@ } PyTypeObject DBusPyUTF8String_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.UTF8String", 0, 0, @@ -161,8 +160,7 @@ } PyTypeObject DBusPyObjectPath_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.ObjectPath", 0, 0, @@ -290,8 +288,7 @@ } PyTypeObject DBusPyString_Type = { - PyObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type)) - 0, + PyVarObject_HEAD_INIT(DEFERRED_ADDRESS(&PyType_Type), 0) "dbus.String", sizeof(DBusPyString), 0,