summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-01-08 11:12:08 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2023-02-23 13:43:15 +0100
commitde3216bfc19b6148f8a60b5a355715bad89b35d6 (patch)
treefdf577403e83e1a4b95c8bd596cbc2d656e284f6
parent224b9ed631473f62598dc6bdd2f512b00cfa627f (diff)
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 <michael.stahl@cib.de> Tested-by: Jenkins (cherry picked from commit fb4e15a89d8d8f081c0c152e5047bc0e76870b39) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86421 Tested-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 46b469d58a0e6b8fbe5888045c272159154a0705)
-rw-r--r--pyuno/source/module/pyuno_runtime.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx
index f583cb9bf7f9..6945b1f20cce 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -981,10 +981,12 @@ 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)
{