Commit 804f26f1 authored by Francois Keith's avatar Francois Keith
Browse files

Correct the PyRun_File use. Close the file once finished. Solves error pointed in previous commit.

parent 4e4d7eef
......@@ -230,8 +230,8 @@ PyObject* Interpreter::globals()
void Interpreter::runPythonFile( std::string filename )
PyObject* pymainContext = globals_;
PyRun_File(fopen( filename.c_str(),"r" ), filename.c_str(),
Py_file_input, pymainContext,pymainContext);
PyRun_FileExFlags(fopen( filename.c_str(),"r" ), filename.c_str(),
Py_file_input, pymainContext,pymainContext, true, NULL);
if (PyErr_Occurred())
std::cout << "Error occures..." << std::endl;
Supports Markdown
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