Skip to content

Commit 1bc123c

Browse files
author
g.ph
committed
update import module bug
1 parent 36cf845 commit 1bc123c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

PyModule.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ func PyModuleFromObj(obj *PyObject) *PyModule {
7676
return dl
7777
}
7878

79-
var pyModuleMethodCallDefs = make([]cpy3.PyMethodDef, 0)
80-
8179
func PyTypeToGoType(p *PyObject) any {
8280

8381
return 0
@@ -139,7 +137,8 @@ var PyModuleMethodForwardCallBack = syscall.NewCallback(func(self uintptr, args
139137
return PyMethodForward(pyModule, newArgs, ifn).Instance()
140138
})
141139

142-
func init() {
140+
func CreateModule(name string, doc string) *PyModule {
141+
var pyModuleMethodCallDefs = make([]cpy3.PyMethodDef, 0)
143142
methodCallDef := cpy3.PyMethodDef{
144143
Ml_name: cpy3.GoStrToCStr("Call"),
145144
Ml_meth: PyModuleMethodForwardCallBack,
@@ -154,9 +153,7 @@ func init() {
154153
Ml_doc: 0,
155154
}
156155
pyModuleMethodCallDefs = append(pyModuleMethodCallDefs, moduleNullMethodDef)
157-
}
158156

159-
func CreateModule(name string, doc string) *PyModule {
160157
module := &PyModule{}
161158
module.GoObj = new(PyModuleGoObj)
162159
module.GoObj.moduleDef = &cpy3.PyModuleDef{

0 commit comments

Comments
 (0)