Skip to content

Commit 9b3b8be

Browse files
author
Drew O'Meara
committed
now testing py.Context.Close()
1 parent 3ccfdff commit 9b3b8be

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

examples/embedding/mylib.module.go

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ func init() {
4747
"GO_VERSION": py.String(fmt.Sprintf("%s on %s %s", runtime.Version(), runtime.GOOS, runtime.GOARCH)),
4848
"MYLIB_VERS": py.String("Vacation 1.0 by Fletch F. Fletcher"),
4949
},
50+
OnContextClosed: func(instance *py.Module) {
51+
fmt.Print("<<< host py.Context of py.Module instance closing >>>\n+++\n")
52+
},
5053
})
5154
}
5255

examples/embedding/testdata/embedding_out_golden.txt

+2
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ Spring Break itinerary:
1515

1616
I bet Monaco will be the best!
1717

18+
<<< host py.Context of py.Module instance closing >>>
19+
+++

0 commit comments

Comments
 (0)