From c517facf67011c9ab563001ebb29e0690b457bd4 Mon Sep 17 00:00:00 2001 From: rnv Date: Fri, 19 May 2017 15:32:06 +0300 Subject: [PATCH] Python3 porting: stdout and stderr redirects in the embeded python console. --- tools/PyInterp/src/PyInterp_Interp.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/PyInterp/src/PyInterp_Interp.cxx b/tools/PyInterp/src/PyInterp_Interp.cxx index 1caeece65..84cca0222 100644 --- a/tools/PyInterp/src/PyInterp_Interp.cxx +++ b/tools/PyInterp/src/PyInterp_Interp.cxx @@ -55,8 +55,7 @@ static PyObject* PyStdOut_write(PyStdOut *self, PyObject *args) { char *c; - int l; - if (!PyArg_ParseTuple(args, "t#:write",&c, &l)) + if (!PyArg_ParseTuple(args, "s",&c)) return NULL; if(self->_cb==NULL) { if ( self->_iscerr ) @@ -136,6 +135,14 @@ static PyTypeObject PyStdOut_Type = { 0, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + 0 /*tp_finalize*/ }; #define PyStdOut_Check(v) ((v)->ob_type == &PyStdOut_Type) -- 2.39.2