summaryrefslogtreecommitdiffstats
path: root/gobject
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2010-04-16 12:57:15 -0400
committerDavid Malcolm <dmalcolm@redhat.com>2010-04-16 13:02:42 -0400
commit15c3b04f4257fef54ca5f7ab60012b4936d672a3 (patch)
tree7681289908d6b6c4cca916fee6d61d2c2f649909 /gobject
parentcecafa7e4809c8c2bfa77446beea8beb3a51d8dc (diff)
downloadpygobject-15c3b04f4257fef54ca5f7ab60012b4936d672a3.tar.gz
pygobject-15c3b04f4257fef54ca5f7ab60012b4936d672a3.tar.xz
pygobject-15c3b04f4257fef54ca5f7ab60012b4936d672a3.zip
Fix various selftests when building against python 3.1
Diffstat (limited to 'gobject')
-rw-r--r--gobject/pygobject.h7
-rw-r--r--gobject/pygtype.c9
2 files changed, 7 insertions, 9 deletions
diff --git a/gobject/pygobject.h b/gobject/pygobject.h
index e3c3df1..8772aa4 100644
--- a/gobject/pygobject.h
+++ b/gobject/pygobject.h
@@ -377,10 +377,17 @@ pygobject_init(int req_major, int req_minor, int req_micro)
}
/* deprecated macro, use pygobject_init() instead. */
+#if PY_VERSION_HEX >= 0x03000000
+#define init_pygobject() G_STMT_START { \
+ if (!pygobject_init(-1, -1, -1)) \
+ return -1; \
+} G_STMT_END
+#else
#define init_pygobject() G_STMT_START { \
if (!pygobject_init(-1, -1, -1)) \
return; \
} G_STMT_END
+#endif
/* deprecated macro, use pygobject_init() instead. */
#define init_pygobject_check(req_major, req_minor, req_micro) G_STMT_START { \
diff --git a/gobject/pygtype.c b/gobject/pygtype.c
index 3915f8f..71769de 100644
--- a/gobject/pygtype.c
+++ b/gobject/pygtype.c
@@ -39,15 +39,6 @@ typedef struct {
PYGLIB_DEFINE_TYPE("gobject.GType", PyGTypeWrapper_Type, PyGTypeWrapper);
-static int
-pyg_type_wrapper_compare(PyGTypeWrapper *self, PyGTypeWrapper *v)
-{
- if (self->type == v->type) return 0;
- if (self->type > v->type) return -1;
- return 1;
-}
-
-
static PyObject*
pyg_type_wrapper_richcompare(PyObject *self, PyObject *other, int op)
{