stdout is sometimes a macro; use "outf" instead.

Submitted by: Mark Favas <m.favas@per.dem.csiro.au>
This commit is contained in:
Greg Stein 2001-01-11 09:27:34 +00:00
parent f68f2fec7d
commit ceb9b7c700

View file

@ -70,7 +70,7 @@ PySys_SetObject(char *name, PyObject *v)
static PyObject * static PyObject *
sys_displayhook(PyObject *self, PyObject *args) sys_displayhook(PyObject *self, PyObject *args)
{ {
PyObject *o, *stdout; PyObject *o, *outf;
PyInterpreterState *interp = PyThreadState_Get()->interp; PyInterpreterState *interp = PyThreadState_Get()->interp;
PyObject *modules = interp->modules; PyObject *modules = interp->modules;
PyObject *builtins = PyDict_GetItemString(modules, "__builtin__"); PyObject *builtins = PyDict_GetItemString(modules, "__builtin__");
@ -90,14 +90,14 @@ sys_displayhook(PyObject *self, PyObject *args)
return NULL; return NULL;
if (Py_FlushLine() != 0) if (Py_FlushLine() != 0)
return NULL; return NULL;
stdout = PySys_GetObject("stdout"); outf = PySys_GetObject("stdout");
if (stdout == NULL) { if (outf == NULL) {
PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout"); PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
return NULL; return NULL;
} }
if (PyFile_WriteObject(o, stdout, 0) != 0) if (PyFile_WriteObject(o, outf, 0) != 0)
return NULL; return NULL;
PyFile_SoftSpace(stdout, 1); PyFile_SoftSpace(outf, 1);
if (Py_FlushLine() != 0) if (Py_FlushLine() != 0)
return NULL; return NULL;
if (PyObject_SetAttrString(builtins, "_", o) != 0) if (PyObject_SetAttrString(builtins, "_", o) != 0)