diff -urN a/libs/python/src/exec.cpp b/libs/python/src/exec.cpp
--- a/libs/python/src/exec.cpp	2020-04-22 16:35:52.000000000 +0300
+++ b/libs/python/src/exec.cpp	2022-06-21 11:59:44.660948012 +0300
@@ -105,7 +105,9 @@
   // should be 'char const *' but older python versions don't use 'const' yet.
   char *f = const_cast<char *>(filename);
   // Let python open the file to avoid potential binary incompatibilities.
-#if PY_VERSION_HEX >= 0x03040000
+#if PY_VERSION_HEX >= 0x030A0000
+  FILE *fs = fopen(f, "r");
+#elif PY_VERSION_HEX >= 0x03040000
   FILE *fs = _Py_fopen(f, "r");
 #elif PY_VERSION_HEX >= 0x03000000
   PyObject *fo = Py_BuildValue("s", f);
