Fixup for python 2

git-svn-id: file:///svn/unbound/trunk@5126 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards
2019-02-27 14:22:55 +00:00
parent 7c1f9699d8
commit ba0cad0bc3
+2 -2
View File
@@ -313,8 +313,8 @@ int pythonmod_init(struct module_env* env, int id)
/* uses python to open the file, this works on other platforms,
* eg. Windows, to open the file in the correct mode for python */
#if PY_MAJOR_VERSION < 3
PyObject* PyFileObject = PyFile_FromString(pe->fname, "r");
script_py = PyFile_AsFile(PyFileObject, pe->fname, 1);
PyFileObject = PyFile_FromString((char*)pe->fname, "r");
script_py = PyFile_AsFile(PyFileObject);
#else
script_py = _Py_fopen(pe->fname, "r");
#endif