From 678d59d21f9cd5af7fa99e692a946e383067a595 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 8 Jul 2016 15:14:48 +0200 Subject: [PATCH] Python 2.7 fixes for eval() --- include/pybind11/eval.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/pybind11/eval.h b/include/pybind11/eval.h index 4dfb1972..b7e7e95c 100644 --- a/include/pybind11/eval.h +++ b/include/pybind11/eval.h @@ -83,7 +83,9 @@ object eval_file(str fname, object global = object(), object local = object()) { FILE *f = _Py_fopen(fname.ptr(), "r"); #else /* No unicode support in open() :( */ - object fobj(PyFile_FromString(fname_str.c_str(), const_cast("r")), false); + object fobj(PyFile_FromString( + const_cast(fname_str.c_str()), + const_cast("r")), false); FILE *f = nullptr; if (fobj) f = PyFile_AsFile(fobj.ptr());