2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-19 04:22:16 +00:00

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
This commit is contained in:
Victor Stinner
2021-01-06 10:07:29 +01:00
committed by Stefan Seefeld
parent 0f1945060f
commit cbd2d9f033

View File

@@ -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.