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>
Thu, 12 Mar 2020 00:57:01 +0000 (00:57 +0000)
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 39effee86a973887a382486b2870e34abd41e578..97473b634fb3c4d5bf280417c18a6c6f23868fdd 100644 (file)
@@ -1128,7 +1128,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