summaryrefslogtreecommitdiff
path: root/_dbus_bindings/abstract.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-12-13 11:38:48 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-12-13 11:38:48 +0000
commitebd44a420264da0031b715f7f08a0b347a81dd30 (patch)
tree0057af95b776a326ccbb34d5e5864be1138097b8 /_dbus_bindings/abstract.c
parentdc1c98f05d29c5b7464d7ac34ee900066f261a86 (diff)
downloaddbus-python-ebd44a420264da0031b715f7f08a0b347a81dd30.tar.gz
Use Py_TYPE() rather than thing->ob_type, for Python 3 portability
Based on part of a patch from Barry Warsaw. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to '_dbus_bindings/abstract.c')
-rw-r--r--_dbus_bindings/abstract.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/_dbus_bindings/abstract.c b/_dbus_bindings/abstract.c
index 30def6e..4797ca5 100644
--- a/_dbus_bindings/abstract.c
+++ b/_dbus_bindings/abstract.c
@@ -201,12 +201,12 @@ DBusPythonInt_tp_repr(PyObject *self)
if (!parent_repr) return NULL;
if (variant_level > 0) {
my_repr = PyString_FromFormat("%s(%s, variant_level=%ld)",
- self->ob_type->tp_name,
+ Py_TYPE(self)->tp_name,
PyString_AS_STRING(parent_repr),
variant_level);
}
else {
- my_repr = PyString_FromFormat("%s(%s)", self->ob_type->tp_name,
+ my_repr = PyString_FromFormat("%s(%s)", Py_TYPE(self)->tp_name,
PyString_AS_STRING(parent_repr));
}
/* whether my_repr is NULL or not: */
@@ -313,12 +313,12 @@ DBusPythonFloat_tp_repr(PyObject *self)
if (!parent_repr) return NULL;
if (variant_level > 0) {
my_repr = PyString_FromFormat("%s(%s, variant_level=%ld)",
- self->ob_type->tp_name,
+ Py_TYPE(self)->tp_name,
PyString_AS_STRING(parent_repr),
variant_level);
}
else {
- my_repr = PyString_FromFormat("%s(%s)", self->ob_type->tp_name,
+ my_repr = PyString_FromFormat("%s(%s)", Py_TYPE(self)->tp_name,
PyString_AS_STRING(parent_repr));
}
/* whether my_repr is NULL or not: */
@@ -424,12 +424,12 @@ DBusPythonString_tp_repr(PyObject *self)
Py_CLEAR(vl_obj);
if (variant_level > 0) {
my_repr = PyString_FromFormat("%s(%s, variant_level=%ld)",
- self->ob_type->tp_name,
+ Py_TYPE(self)->tp_name,
PyString_AS_STRING(parent_repr),
variant_level);
}
else {
- my_repr = PyString_FromFormat("%s(%s)", self->ob_type->tp_name,
+ my_repr = PyString_FromFormat("%s(%s)", Py_TYPE(self)->tp_name,
PyString_AS_STRING(parent_repr));
}
/* whether my_repr is NULL or not: */
@@ -542,12 +542,12 @@ DBusPythonLong_tp_repr(PyObject *self)
Py_CLEAR(vl_obj);
if (variant_level) {
my_repr = PyString_FromFormat("%s(%s, variant_level=%ld)",
- self->ob_type->tp_name,
+ Py_TYPE(self)->tp_name,
PyString_AS_STRING(parent_repr),
variant_level);
}
else {
- my_repr = PyString_FromFormat("%s(%s)", self->ob_type->tp_name,
+ my_repr = PyString_FromFormat("%s(%s)", Py_TYPE(self)->tp_name,
PyString_AS_STRING(parent_repr));
}
/* whether my_repr is NULL or not: */