This commit is contained in:
Vitor Santos Costa
2016-09-30 17:11:13 -05:00
parent 41ccbf7367
commit 43d3579c57
19 changed files with 397 additions and 411 deletions

View File

@@ -49,7 +49,11 @@ PyObject *term_to_python(term_t t, bool eval) {
else if (strcmp(s, "{}") == 0)
o = PyDict_New();
/* return __main__,s */
else if (PyObject_HasAttrString(py_Main, s)) {
else if ((o = PyRun_String(s, Py_single_input,
PyEval_GetGlobals(), PyEval_GetLocals()))) {
Py_IncRef(o);
return o;
} else if (PyObject_HasAttrString(py_Main, s)) {
o = PyObject_GetAttrString(py_Main, s);
} else {
o = PyUnicode_FromString(s);