Skip to content

Commit cbd2d9f

Browse files
vstinnerstefanseefeld
authored andcommitted
Fix compatibility with Python 3.10.0a4: fopen
Replace private _Py_fopen() with public fopen(): private _Py_fopen() function was removed in 3.10.0a4: https://bugs.python.org/issue32381
1 parent 0f19450 commit cbd2d9f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/exec.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ object BOOST_PYTHON_DECL exec_file(char const *filename, object global, object l
116116
#elif PY_VERSION_HEX >= 0x03000000
117117
// Let python open the file to avoid potential binary incompatibilities.
118118
PyObject *fo = Py_BuildValue("s", f);
119-
FILE *fs = _Py_fopen(fo, "r"); // Private CPython API
119+
FILE *fs = fopen(fo, "r");
120120
Py_DECREF(fo);
121121
#else
122122
// Let python open the file to avoid potential binary incompatibilities.

0 commit comments

Comments
 (0)