summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 5fa923c236dc..e0987cd63cd7 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -979,10 +979,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)
{