--- gobject/pygobject.c	2017-10-13 12:01:53.000000000 +0200
+++ gobject/pygobject.c	2020-10-20 07:05:31.000000000 +0200
@@ -823,7 +823,10 @@
                                   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
+                                  };
     int i;

     /* Happens when registering gobject.GObject itself, at least. */
