summaryrefslogtreecommitdiffstats
path: root/gio
diff options
context:
space:
mode:
authorJohn Ehresman <jpe@wingware.com>2010-04-02 16:08:07 -0400
committerJohn Ehresman <jpe@wingware.com>2010-04-15 12:13:34 -0400
commit13a5da14842caa6a80e6ed7237422b984a152cd8 (patch)
treeaa4139bf93ffd7730850057c9f4de975068294a8 /gio
parent681832c3cd040433a488a400693b68f213bf7078 (diff)
downloadpygobject-13a5da14842caa6a80e6ed7237422b984a152cd8.tar.gz
pygobject-13a5da14842caa6a80e6ed7237422b984a152cd8.tar.xz
pygobject-13a5da14842caa6a80e6ed7237422b984a152cd8.zip
Use richcompare slot rather than old compare slot and Py_TYPE macro in preparation for py3k support
Diffstat (limited to 'gio')
-rw-r--r--gio/gappinfo.override4
-rw-r--r--gio/gdrive.override4
-rw-r--r--gio/gfile.override6
-rw-r--r--gio/gfileattribute.override5
-rw-r--r--gio/gicon.override6
-rw-r--r--gio/gmount.override6
-rw-r--r--gio/gvolume.override4
7 files changed, 17 insertions, 18 deletions
diff --git a/gio/gappinfo.override b/gio/gappinfo.override
index 414769b..ddfd28d 100644
--- a/gio/gappinfo.override
+++ b/gio/gappinfo.override
@@ -31,7 +31,7 @@ _wrap__install_app_info_meta(PyObject *self, PyObject *args)
return NULL;
Py_INCREF(metaclass);
- PyGAppInfo_Type.ob_type = (PyTypeObject*)metaclass;
+ Py_TYPE(&PyGAppInfo_Type) = (PyTypeObject*)metaclass;
Py_INCREF(Py_None);
return Py_None;
@@ -199,7 +199,7 @@ _wrap_g_app_info_tp_repr(PyGObject *self)
PyObject *result;
representation = g_strdup_printf("<%s at %p: %s>",
- self->ob_type->tp_name, self,
+ Py_TYPE(self)->tp_name, self,
name ? name : "UNKNOWN NAME");
result = PyString_FromString(representation);
diff --git a/gio/gdrive.override b/gio/gdrive.override
index 7961856..8362ae0 100644
--- a/gio/gdrive.override
+++ b/gio/gdrive.override
@@ -154,11 +154,11 @@ _wrap_g_drive_tp_repr(PyGObject *self)
PyObject *result;
if (name) {
- representation = g_strdup_printf("<%s at %p: %s>", self->ob_type->tp_name, self, name);
+ representation = g_strdup_printf("<%s at %p: %s>", Py_TYPE(self)->tp_name, self, name);
g_free(name);
}
else
- representation = g_strdup_printf("<%s at %p: UNKNOWN NAME>", self->ob_type->tp_name, self);
+ representation = g_strdup_printf("<%s at %p: UNKNOWN NAME>", Py_TYPE(self)->tp_name, self);
result = PyString_FromString(representation);
g_free(representation);
diff --git a/gio/gfile.override b/gio/gfile.override
index f793ef8..3733192 100644
--- a/gio/gfile.override
+++ b/gio/gfile.override
@@ -62,7 +62,7 @@ _wrap__install_file_meta(PyObject *self, PyObject *args)
return NULL;
Py_INCREF(metaclass);
- PyGFile_Type.ob_type = (PyTypeObject*)metaclass;
+ Py_TYPE(&PyGFile_Type) = (PyTypeObject*)metaclass;
Py_INCREF(Py_None);
return Py_None;
@@ -1498,11 +1498,11 @@ _wrap_g_file_tp_repr(PyGObject *self)
PyObject *result;
if (uri) {
- representation = g_strdup_printf("<%s at %p: %s>", self->ob_type->tp_name, self, uri);
+ representation = g_strdup_printf("<%s at %p: %s>", Py_TYPE(self)->tp_name, self, uri);
g_free(uri);
}
else
- representation = g_strdup_printf("<%s at %p: UNKNOWN URI>", self->ob_type->tp_name, self);
+ representation = g_strdup_printf("<%s at %p: UNKNOWN URI>", Py_TYPE(self)->tp_name, self);
result = PyString_FromString(representation);
g_free(representation);
diff --git a/gio/gfileattribute.override b/gio/gfileattribute.override
index e51ec63..5f3e552 100644
--- a/gio/gfileattribute.override
+++ b/gio/gfileattribute.override
@@ -83,8 +83,7 @@ static const PyGetSetDef pyg_file_attribute_info_getsets[] = {
};
PyTypeObject PyGFileAttributeInfo_Type = {
- PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
+ PyVarObject_HEAD_INIT(NULL, 0)
"gio.FileAttributeInfo", /* tp_name */
sizeof(PyGFileAttributeInfo), /* tp_basicsize */
0, /* tp_itemsize */
@@ -93,7 +92,7 @@ PyTypeObject PyGFileAttributeInfo_Type = {
(printfunc)0, /* tp_print */
(getattrfunc)0, /* tp_getattr */
(setattrfunc)0, /* tp_setattr */
- (cmpfunc)0, /* tp_compare */
+ NULL, /* tp_compare */
(reprfunc)0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
diff --git a/gio/gicon.override b/gio/gicon.override
index c429556..9d27495 100644
--- a/gio/gicon.override
+++ b/gio/gicon.override
@@ -177,11 +177,11 @@ _wrap_g_file_icon_tp_repr(PyGObject *self)
PyObject *result;
if (uri) {
- representation = g_strdup_printf("<%s at %p: %s>", self->ob_type->tp_name, self, uri);
+ representation = g_strdup_printf("<%s at %p: %s>", Py_TYPE(self)->tp_name, self, uri);
g_free(uri);
}
else
- representation = g_strdup_printf("<%s at %p: UNKNOWN URI>", self->ob_type->tp_name, self);
+ representation = g_strdup_printf("<%s at %p: UNKNOWN URI>", Py_TYPE(self)->tp_name, self);
result = PyString_FromString(representation);
g_free(representation);
@@ -275,7 +275,7 @@ _wrap_g_themed_icon_tp_repr(PyGObject *self)
GString *representation = g_string_new(NULL);
PyObject *result;
- g_string_append_printf(representation, "<%s at %p: ", self->ob_type->tp_name, self);
+ g_string_append_printf(representation, "<%s at %p: ", Py_TYPE(self)->tp_name, self);
if (names) {
gboolean first_name = TRUE;
diff --git a/gio/gmount.override b/gio/gmount.override
index 9fb0828..54d5dd2 100644
--- a/gio/gmount.override
+++ b/gio/gmount.override
@@ -327,15 +327,15 @@ _wrap_g_mount_tp_repr(PyGObject *self)
if (name) {
if (uuid) {
representation = g_strdup_printf("<%s at %p: %s (%s)>",
- self->ob_type->tp_name, self, name, uuid);
+ Py_TYPE(self)->tp_name, self, name, uuid);
}
else {
representation = g_strdup_printf("<%s at %p: %s>",
- self->ob_type->tp_name, self, name);
+ Py_TYPE(self)->tp_name, self, name);
}
}
else
- representation = g_strdup_printf("<%s at %p: UNKNOWN NAME>", self->ob_type->tp_name, self);
+ representation = g_strdup_printf("<%s at %p: UNKNOWN NAME>", Py_TYPE(self)->tp_name, self);
g_free(name);
g_free(uuid);
diff --git a/gio/gvolume.override b/gio/gvolume.override
index 89c27e4..83b855d 100644
--- a/gio/gvolume.override
+++ b/gio/gvolume.override
@@ -148,11 +148,11 @@ _wrap_g_volume_tp_repr(PyGObject *self)
PyObject *result;
if (name) {
- representation = g_strdup_printf("<%s at %p: %s>", self->ob_type->tp_name, self, name);
+ representation = g_strdup_printf("<%s at %p: %s>", Py_TYPE(self)->tp_name, self, name);
g_free(name);
}
else
- representation = g_strdup_printf("<%s at %p: UNKNOWN NAME>", self->ob_type->tp_name, self);
+ representation = g_strdup_printf("<%s at %p: UNKNOWN NAME>", Py_TYPE(self)->tp_name, self);
result = PyString_FromString(representation);
g_free(representation);