mirror of
https://github.com/boostorg/python.git
synced 2026-01-24 06:02:14 +00:00
Boost.Python:
* Workarounds for many SunCC 5.9 bugs * Suppression of many SunCC 5.9 warnings * Improve the style of some test invocations in Jamfile [SVN r41521]
This commit is contained in:
@@ -39,7 +39,7 @@ object BOOST_PYTHON_DECL exec_file(str filename, object global, object local)
|
||||
// should be 'char const *' but older python versions don't use 'const' yet.
|
||||
char *f = python::extract<char *>(filename);
|
||||
// Let python open the file to avoid potential binary incompatibilities.
|
||||
PyObject *pyfile = PyFile_FromString(f, "r");
|
||||
PyObject *pyfile = PyFile_FromString(f, const_cast<char*>("r"));
|
||||
if (!pyfile) throw std::invalid_argument(std::string(f) + " : no such file");
|
||||
python::handle<> file(pyfile);
|
||||
PyObject* result = PyRun_File(PyFile_AsFile(file.get()),
|
||||
|
||||
Reference in New Issue
Block a user