fix compatibility with Python 3.8
authorSteve Langasek <steve.langasek@ubuntu.com>
Wed, 11 Mar 2020 10:49:13 +0000 (06:49 -0400)
committerThomas Krennwallner <tkren@kr.tuwien.ac.at>
Fri, 3 Apr 2020 10:56:49 +0000 (11:56 +0100)
Last-Update: 2020-02-20
Forwarded: no
Bug-Debian: https://bugs.debian.org/951707

Python 3.8 changes the type of an element of the PyTypeObject struct
(https://www.python.org/dev/peps/pep-0590/) leading to compiler errors.

Gbp-Pq: Name python3.8-compat.patch

libpyclingo/pyclingo.cc

index 9480203ab4c34aac082241acb9550ed69e9613c4..31293dad8df051c628e77b3b3a3ff78ea281d99e 100644 (file)
@@ -1177,7 +1177,11 @@ PyTypeObject ObjectBase<T>::type = {
     sizeof(T),                                  // tp_basicsize
     0,                                          // tp_itemsize
     PythonDetail::Get_tp_dealloc<T>::value,     // tp_dealloc
+#if PY_VERSION_HEX >= 0x03080000
+    0,                                          // tp_vectorcall_offset
+#else
     nullptr,                                    // tp_print
+#endif
     nullptr,                                    // tp_getattr
     nullptr,                                    // tp_setattr
     nullptr,                                    // tp_compare