Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
dynamic-graph-python
Commits
804f26f1
Commit
804f26f1
authored
Mar 15, 2014
by
Francois Keith
Browse files
Correct the PyRun_File use. Close the file once finished. Solves error pointed in previous commit.
parent
4e4d7eef
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/interpreter.cc
View file @
804f26f1
...
...
@@ -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_File
ExFlags
(
fopen
(
filename
.
c_str
(),
"r"
),
filename
.
c_str
(),
Py_file_input
,
pymainContext
,
pymainContext
,
true
,
NULL
);
if
(
PyErr_Occurred
())
{
std
::
cout
<<
"Error occures..."
<<
std
::
endl
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment