From: Wouter Wijngaards Date: Wed, 27 Feb 2019 14:22:55 +0000 (+0000) Subject: Fixup for python 2 X-Git-Tag: release-1.9.1rc1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba0cad0bc313c22e0e4fd237ba775b8ebaacb976;p=thirdparty%2Funbound.git Fixup for python 2 git-svn-id: file:///svn/unbound/trunk@5126 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/pythonmod/pythonmod.c b/pythonmod/pythonmod.c index 25e1bc08a..459ae1e8c 100644 --- a/pythonmod/pythonmod.c +++ b/pythonmod/pythonmod.c @@ -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