Skip to content

Commit

Permalink
Fix compatibility with Python 3.10.0a4: fopen
Browse files Browse the repository at this point in the history
Replace private _Py_fopen() with public fopen(): private _Py_fopen()
function was removed in 3.10.0a4:
https://bugs.python.org/issue32381
  • Loading branch information
vstinner authored and stefanseefeld committed Jan 6, 2021
1 parent 0f19450 commit cbd2d9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/exec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ object BOOST_PYTHON_DECL exec_file(char const *filename, object global, object l
#elif PY_VERSION_HEX >= 0x03000000
// Let python open the file to avoid potential binary incompatibilities.
PyObject *fo = Py_BuildValue("s", f);
FILE *fs = _Py_fopen(fo, "r"); // Private CPython API
FILE *fs = fopen(fo, "r");
Py_DECREF(fo);
#else
// Let python open the file to avoid potential binary incompatibilities.
Expand Down

0 comments on commit cbd2d9f

Please sign in to comment.