[Python-checkins] python/dist/src/Python bltinmodule.c,2.265,2.266
loewis@users.sourceforge.net
loewis@users.sourceforge.net
Sat, 26 Oct 2002 07:39:12 -0700
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv26440/Python
Modified Files:
bltinmodule.c
Log Message:
Patch #512981: Update readline input stream on sys.stdin/out change.
Index: bltinmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v
retrieving revision 2.265
retrieving revision 2.266
diff -C2 -d -r2.265 -r2.266
*** bltinmodule.c 27 Aug 2002 16:58:00 -0000 2.265
--- bltinmodule.c 26 Oct 2002 14:39:10 -0000 2.266
***************
*** 1312,1317 ****
return NULL;
}
! if (PyFile_AsFile(fin) == stdin && PyFile_AsFile(fout) == stdout &&
! isatty(fileno(stdin)) && isatty(fileno(stdout))) {
PyObject *po;
char *prompt;
--- 1312,1318 ----
return NULL;
}
! if (PyFile_Check (fin) && PyFile_Check (fout)
! && isatty(fileno(PyFile_AsFile(fin)))
! && isatty(fileno(PyFile_AsFile(fout)))) {
PyObject *po;
char *prompt;
***************
*** 1330,1334 ****
prompt = "";
}
! s = PyOS_Readline(prompt);
Py_XDECREF(po);
if (s == NULL) {
--- 1331,1336 ----
prompt = "";
}
! s = PyOS_Readline(PyFile_AsFile (fin), PyFile_AsFile (fout),
! prompt);
Py_XDECREF(po);
if (s == NULL) {