mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-02-05 06:53:36 +08:00
Python 2.7 fixes for eval()
This commit is contained in:
parent
464c43513e
commit
678d59d21f
@ -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());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user