diff --git a/src/exec.cpp b/src/exec.cpp index 1268fbf8..aa876031 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -85,7 +85,7 @@ object BOOST_PYTHON_DECL exec_file(str filename, object global, object local) // should be 'char const *' but older python versions don't use 'const' yet. char *f = python::extract(filename); #if PY_VERSION_HEX >= 0x03040000 - FILE *fs = fopen(f, "r"); + FILE *fs = _Py_fopen(f, "r"); #elif PY_VERSION_HEX >= 0x03000000 PyObject *fo = Py_BuildValue("s", f); FILE *fs = _Py_fopen(fo, "r");