2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-21 05:02:17 +00:00

-fix: issue #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.

This commit is contained in:
Hajo Kirchhoff
2021-08-10 13:26:02 +02:00
committed by Stefan Seefeld
parent a060d43bf2
commit f028aa4076

View File

@@ -129,6 +129,7 @@ object BOOST_PYTHON_DECL exec_file(char const *filename, object global, object l
f,
Py_file_input,
global.ptr(), local.ptr());
fclose(fs);
if (!result) throw_error_already_set();
return object(detail::new_reference(result));
}