Commit 678d59d2 by Wenzel Jakob

Python 2.7 fixes for eval()

parent 464c4351
...@@ -83,7 +83,9 @@ object eval_file(str fname, object global = object(), object local = object()) { ...@@ -83,7 +83,9 @@ object eval_file(str fname, object global = object(), object local = object()) {
FILE *f = _Py_fopen(fname.ptr(), "r"); FILE *f = _Py_fopen(fname.ptr(), "r");
#else #else
/* No unicode support in open() :( */ /* No unicode support in open() :( */
object fobj(PyFile_FromString(fname_str.c_str(), const_cast<char*>("r")), false); object fobj(PyFile_FromString(
const_cast<char *>(fname_str.c_str()),
const_cast<char*>("r")), false);
FILE *f = nullptr; FILE *f = nullptr;
if (fobj) if (fobj)
f = PyFile_AsFile(fobj.ptr()); f = PyFile_AsFile(fobj.ptr());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment