[Python-checkins] CVS: python/dist/src/Python sysmodule.c,2.81,2.82
Greg Stein
python-dev@python.org
Thu, 11 Jan 2001 01:27:37 -0800
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv14530
Modified Files:
sysmodule.c
Log Message:
stdout is sometimes a macro; use "outf" instead.
Submitted by: Mark Favas <m.favas@per.dem.csiro.au>
Index: sysmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v
retrieving revision 2.81
retrieving revision 2.82
diff -C2 -r2.81 -r2.82
*** sysmodule.c 2001/01/11 05:41:27 2.81
--- sysmodule.c 2001/01/11 09:27:34 2.82
***************
*** 71,75 ****
sys_displayhook(PyObject *self, PyObject *args)
{
! PyObject *o, *stdout;
PyInterpreterState *interp = PyThreadState_Get()->interp;
PyObject *modules = interp->modules;
--- 71,75 ----
sys_displayhook(PyObject *self, PyObject *args)
{
! PyObject *o, *outf;
PyInterpreterState *interp = PyThreadState_Get()->interp;
PyObject *modules = interp->modules;
***************
*** 91,102 ****
if (Py_FlushLine() != 0)
return NULL;
! stdout = PySys_GetObject("stdout");
! if (stdout == NULL) {
PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
return NULL;
}
! if (PyFile_WriteObject(o, stdout, 0) != 0)
return NULL;
! PyFile_SoftSpace(stdout, 1);
if (Py_FlushLine() != 0)
return NULL;
--- 91,102 ----
if (Py_FlushLine() != 0)
return NULL;
! outf = PySys_GetObject("stdout");
! if (outf == NULL) {
PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
return NULL;
}
! if (PyFile_WriteObject(o, outf, 0) != 0)
return NULL;
! PyFile_SoftSpace(outf, 1);
if (Py_FlushLine() != 0)
return NULL;