]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
From Community Forum: add isatty() method to embedded interpreter (needed for some...
authorvsr <vsr@opencascade.com>
Tue, 26 Jan 2021 09:29:28 +0000 (12:29 +0300)
committervsr <vsr@opencascade.com>
Tue, 26 Jan 2021 09:29:28 +0000 (12:29 +0300)
tools/PyInterp/src/PyInterp_Interp.cxx

index 38f5223106460ea895f8dbe703cedb60bee8ce8b..deca49c795655c8cf668fbce70cc2fc7a06ec332 100644 (file)
@@ -78,10 +78,17 @@ PyStdOut_flush(PyStdOut * /*self*/, PyObject * /*args*/)
   return Py_None;
 }
 
+static PyObject*
+PyStdOut_isatty(PyStdOut * /*self*/, PyObject */*args*/)
+{
+  return Py_False;
+}
+
 static PyMethodDef PyStdOut_methods[] = {
   {"write",  (PyCFunction)PyStdOut_write,  METH_VARARGS, PyDoc_STR("write(string) -> None")},
   {"flush",  (PyCFunction)PyStdOut_flush,  METH_NOARGS,  PyDoc_STR("flush() -> None")},
-  {NULL, (PyCFunction)NULL, 0, NULL}   /* sentinel */
+  {"isatty", (PyCFunction)PyStdOut_isatty, METH_NOARGS,  PyDoc_STR("isatty() -> bool")},
+  {NULL,     (PyCFunction)NULL,            0,            NULL}   /* sentinel */
 };
 
 static PyMemberDef PyStdOut_memberlist[] = {