Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit 4941be0

Browse files
committed
veryhigh: add defer to fclose in PyRun_SimpleFile
Updates #40.
1 parent 8949822 commit 4941be0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

veryhigh.go

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ func PyRun_SimpleFile(filename string) error {
4747
if err != nil || cfile == nil {
4848
return fmt.Errorf("python: could not open %s: %v", filename, err)
4949
}
50+
defer C.fclose(cfile)
5051

5152
retcode := C.PyRun_SimpleFileExFlags(cfile, cfname, 0, nil)
5253
if retcode != 0 {

0 commit comments

Comments
 (0)