diff options
Diffstat (limited to 'sca-cpp/trunk/modules/python/driver.hpp')
-rw-r--r-- | sca-cpp/trunk/modules/python/driver.hpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sca-cpp/trunk/modules/python/driver.hpp b/sca-cpp/trunk/modules/python/driver.hpp index 79897b0c5e..a5d554172b 100644 --- a/sca-cpp/trunk/modules/python/driver.hpp +++ b/sca-cpp/trunk/modules/python/driver.hpp @@ -35,26 +35,26 @@ namespace tuscany { namespace python { -const value evalDriverLoop(PyObject* script, istream& in, ostream& out) { +const value evalDriverLoop(PyObject* script, istream& in, ostream& out, PythonRuntime& py) { scheme::promptForInput(scheme::evalInputPrompt, out); value input = scheme::readValue(in); if (isNil(input)) return input; - const failable<value> output = evalScript(input, script); + const failable<value> output = evalScript(input, script, py); scheme::announceOutput(scheme::evalOutputPrompt, out); scheme::userPrint(content(output), out); - return evalDriverLoop(script, in, out); + return evalDriverLoop(script, in, out, py); } const bool evalDriverRun(const char* path, istream& in, ostream& out) { PythonRuntime py; scheme::setupDisplay(out); ifstream is(path); - failable<PyObject*> script = readScript(moduleName(path), path, is); + failable<PyObject*> script = readScript(moduleName(path), path, is, py); if (!hasContent(script)) return true; - evalDriverLoop(content(script), in, out); - Py_DECREF(content(script)); + evalDriverLoop(content(script), in, out, py); + releaseScript(content(script), py); return true; } |