From fb4e15a89d8d8f081c0c152e5047bc0e76870b39 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 8 Jan 2020 11:12:08 +0100 Subject: pyuno: fix build against system-python-3.6 pyuno/source/module/pyuno_runtime.cxx:984:57: error: use of undeclared identifier 'PyThread_get_thread_ident' It's only an assert, so simply do it only for >=3.7. Change-Id: Ia3fffc7a9af30780adff9bc7dbabe1727c1f8f54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86410 Reviewed-by: Michael Stahl Tested-by: Jenkins --- pyuno/source/module/pyuno_runtime.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pyuno') diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx index 5fa923c236dc..e0987cd63cd7 100644 --- a/pyuno/source/module/pyuno_runtime.cxx +++ b/pyuno/source/module/pyuno_runtime.cxx @@ -979,9 +979,11 @@ PyThreadAttach::PyThreadAttach( PyInterpreterState *interp) // note: *may* be called recursively, with PyThreadDetach between - in // that case, don't create *new* PyThreadState but reuse! #ifndef NDEBUG +#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 7 PyThreadState const*const current = _PyThreadState_UncheckedGet(); // dereference isn't safe but let's hope it's tolerable for debugging purpose assert((current == nullptr || current->thread_id != PyThread_get_thread_ident()) && "recursive PyThreadAttach"); +#endif #endif tstate = PyGILState_GetThisThreadState(); // from TLS, possibly detached if (!tstate) -- cgit v1.2.3