Specify python3.8-embed pkg-config and remove functions no longer in python 3.8

v3.8.0
Stein Ivar Berghei 2021-11-19 13:42:50 +01:00
parent 8c7eedeae7
commit cccfd203f8
3 changed files with 1 additions and 15 deletions

View File

@ -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"

View File

@ -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())

View File

@ -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()