We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 51a670d commit 796854cCopy full SHA for 796854c
math/math_test.go
@@ -1,14 +1,12 @@
1
package math
2
3
import (
4
- "runtime"
5
"testing"
6
7
gp "github.com/cpunion/go-python"
8
)
9
10
func TestSqrt(t *testing.T) {
11
- runtime.LockOSThread()
12
// Initialize Python
13
gp.Initialize()
14
defer gp.Finalize()
python.go
@@ -8,13 +8,15 @@ import "C"
"fmt"
"reflect"
+ "runtime"
"unsafe"
15
type PyObject = C.PyObject
16
type PyCFunction = C.PyCFunction
17
18
func Initialize() {
19
+ runtime.LockOSThread()
20
C.Py_Initialize()
21
}
22
python_test.go
@@ -6,7 +6,6 @@ import (
func setupTest(t *testing.T) {
Initialize()
t.Cleanup(func() {
runtime.GC()
0 commit comments