Skip to content

Commit f028aa4

Browse files
Hajo Kirchhoffstefanseefeld
authored andcommitted
-fix: issue boostorg#239 exec_file does not close the FILE handle. Note: Using FILE* is a bad choice here because of possible exceptions, but Py_RunFile is a C function. This fix works, because Py_RunFile - as a C function - does not throw exceptions.
1 parent a060d43 commit f028aa4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/exec.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ object BOOST_PYTHON_DECL exec_file(char const *filename, object global, object l
129129
f,
130130
Py_file_input,
131131
global.ptr(), local.ptr());
132+
fclose(fs);
132133
if (!result) throw_error_already_set();
133134
return object(detail::new_reference(result));
134135
}

0 commit comments

Comments
 (0)