[pygobject/py3.8-fixes: 3/5] Don't use PyTypeObject.tp_print with Python 3
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject/py3.8-fixes: 3/5] Don't use PyTypeObject.tp_print with Python 3
- Date: Fri, 7 Jun 2019 14:58:33 +0000 (UTC)
commit 07cb8d7dfc2fe93c3dd0dc4c4ddb88556de048e0
Author: Christoph Reiter <reiter christoph gmail com>
Date: Fri Jun 7 16:31:23 2019 +0200
Don't use PyTypeObject.tp_print with Python 3
It was only used with Python 2 and unused/reserved with Python 3.
Python 3.8 has renamed the slot and is now using it for something different
which breaks our build.
gi/pygobject-object.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gi/pygobject-object.c b/gi/pygobject-object.c
index dbf46e1e..39c03ca3 100644
--- a/gi/pygobject-object.c
+++ b/gi/pygobject-object.c
@@ -878,7 +878,10 @@ pygobject_inherit_slots(PyTypeObject *type, PyObject *bases, gboolean check_for_
offsetof(PyTypeObject, tp_iter),
offsetof(PyTypeObject, tp_repr),
offsetof(PyTypeObject, tp_str),
- offsetof(PyTypeObject, tp_print) };
+#if PY_VERSION_HEX < 0x03000000
+ offsetof(PyTypeObject, tp_print),
+#endif
+ };
gsize i;
/* Happens when registering gobject.GObject itself, at least. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]