From cccfd203f840667fc0c83c76ef209de90ed7d36c Mon Sep 17 00:00:00 2001 From: Stein Ivar Berghei Date: Fri, 19 Nov 2021 13:42:50 +0100 Subject: [PATCH] Specify python3.8-embed pkg-config and remove functions no longer in python 3.8 --- high_level_layer.go | 2 +- thread.go | 5 ----- thread_test.go | 9 --------- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/high_level_layer.go b/high_level_layer.go index 0119b16..8695ca7 100644 --- a/high_level_layer.go +++ b/high_level_layer.go @@ -8,7 +8,7 @@ Copyright 2018 Datadog, Inc. package python3 /* -#cgo pkg-config: python3 +#cgo pkg-config: python-3.8-embed #include "Python.h" */ import "C" diff --git a/thread.go b/thread.go index f394d1d..70667fc 100644 --- a/thread.go +++ b/thread.go @@ -48,11 +48,6 @@ func PyThreadState_Swap(tstate *PyThreadState) *PyThreadState { return (*PyThreadState)(C.PyThreadState_Swap((*C.PyThreadState)(tstate))) } -//PyEval_ReInitThreads : https://docs.python.org/3/c-api/init.html#c.PyEval_ReInitThreads -func PyEval_ReInitThreads() { - C.PyEval_ReInitThreads() -} - //PyGILState_Ensure : https://docs.python.org/3/c-api/init.html#c.PyGILState_Ensure func PyGILState_Ensure() PyGILState { return PyGILState(C.PyGILState_Ensure()) diff --git a/thread_test.go b/thread_test.go index 2e78935..6ffc2ea 100644 --- a/thread_test.go +++ b/thread_test.go @@ -6,15 +6,6 @@ import ( "github.com/stretchr/testify/assert" ) -func TestThreadInitialization(t *testing.T) { - Py_Initialize() - PyEval_InitThreads() - - assert.True(t, PyEval_ThreadsInitialized()) - - PyEval_ReInitThreads() -} - func TestGIL(t *testing.T) { Py_Initialize() PyEval_InitThreads()