PyInit
This commit is contained in:
@@ -79,6 +79,10 @@ func Gen(pkgPath, inFile string, src any) string {
|
||||
ret, err := cl.NewPackage(prog, ssaPkg, files)
|
||||
check(err)
|
||||
|
||||
if prog.NeedPyInit() { // call PyInit if needed
|
||||
ret.PyInit()
|
||||
}
|
||||
|
||||
return ret.String()
|
||||
}
|
||||
|
||||
|
||||
@@ -82,6 +82,10 @@ func GenFrom(fileOrPkg string) string {
|
||||
ret, err := cl.NewPackage(prog, ssaPkg, pkg.Syntax)
|
||||
check(err)
|
||||
|
||||
if prog.NeedPyInit() { // call PyInit if needed
|
||||
ret.PyInit()
|
||||
}
|
||||
|
||||
return ret.String()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user