Content-Length: 253224 | pFad | http://github.com/sbinet/go-python/commit/4941be0ff9f8c67ab9ea779d8d292827a5af8546

BA veryhigh: add defer to fclose in PyRun_SimpleFile · sbinet/go-python@4941be0 · GitHub
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

Lines changed: 1 addition & 0 deletions
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/sbinet/go-python/commit/4941be0ff9f8c67ab9ea779d8d292827a5af8546

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy