From 13a896b6a762e48c2396e3dc9f2e794020f4e6e8 Mon Sep 17 00:00:00 2001 From: Till Hofmann Date: Fri, 6 Sep 2019 10:17:59 +0200 Subject: [PATCH] Use 0 instead of nullptr for python's tp_print for Python 3.8 In Python 3.8, the reserved `tp_print` slot was changed from a function pointer to a number. In C, there is no `nullptr`; either a 0 or NULL casts automatically to both pointers and numbers. Replace `nullptr` with `0` for `tp_print` to be compatible with Python 3.8. --- libpyclingo/pyclingo.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpyclingo/pyclingo.cc b/libpyclingo/pyclingo.cc index 9480203a..6a7068cc 100644 --- a/libpyclingo/pyclingo.cc +++ b/libpyclingo/pyclingo.cc @@ -1177,7 +1177,7 @@ PyTypeObject ObjectBase::type = { sizeof(T), // tp_basicsize 0, // tp_itemsize PythonDetail::Get_tp_dealloc::value, // tp_dealloc - nullptr, // tp_print + 0, // tp_print nullptr, // tp_getattr nullptr, // tp_setattr nullptr, // tp_compare