Reflow long lines.

This commit is contained in:
Jeremy Hylton 2002-08-14 21:01:41 +00:00
parent 794643c314
commit 8b73542cf5

View file

@ -90,7 +90,8 @@ dircheck(PyFileObject* f)
#else #else
char *msg = "Is a directory"; char *msg = "Is a directory";
#endif #endif
PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(is)", EISDIR, msg); PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(is)",
EISDIR, msg);
PyErr_SetObject(PyExc_IOError, exc); PyErr_SetObject(PyExc_IOError, exc);
return NULL; return NULL;
} }
@ -755,7 +756,8 @@ file_readinto(PyFileObject *f, PyObject *args)
while (ntodo > 0) { while (ntodo > 0) {
Py_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS
errno = 0; errno = 0;
nnow = Py_UniversalNewlineFread(ptr+ndone, ntodo, f->f_fp, (PyObject *)f); nnow = Py_UniversalNewlineFread(ptr+ndone, ntodo, f->f_fp,
(PyObject *)f);
Py_END_ALLOW_THREADS Py_END_ALLOW_THREADS
if (nnow == 0) { if (nnow == 0) {
if (!ferror(f->f_fp)) if (!ferror(f->f_fp))
@ -1025,8 +1027,9 @@ get_line(PyFileObject *f, int n)
if (skipnextlf ) { if (skipnextlf ) {
skipnextlf = 0; skipnextlf = 0;
if (c == '\n') { if (c == '\n') {
/* Seeing a \n here with skipnextlf true /* Seeing a \n here with
** means we saw a \r before. * skipnextlf true means we
* saw a \r before.
*/ */
newlinetypes |= NEWLINE_CRLF; newlinetypes |= NEWLINE_CRLF;
c = GETC(fp); c = GETC(fp);
@ -1594,7 +1597,9 @@ get_newlines(PyFileObject *f, void *closure)
case NEWLINE_CR|NEWLINE_LF|NEWLINE_CRLF: case NEWLINE_CR|NEWLINE_LF|NEWLINE_CRLF:
return Py_BuildValue("(sss)", "\r", "\n", "\r\n"); return Py_BuildValue("(sss)", "\r", "\n", "\r\n");
default: default:
PyErr_Format(PyExc_SystemError, "Unknown newlines value 0x%x\n", f->f_newlinetypes); PyErr_Format(PyExc_SystemError,
"Unknown newlines value 0x%x\n",
f->f_newlinetypes);
return NULL; return NULL;
} }
} }
@ -1603,7 +1608,8 @@ get_newlines(PyFileObject *f, void *closure)
static PyGetSetDef file_getsetlist[] = { static PyGetSetDef file_getsetlist[] = {
{"closed", (getter)get_closed, NULL, "True if the file is closed"}, {"closed", (getter)get_closed, NULL, "True if the file is closed"},
#ifdef WITH_UNIVERSAL_NEWLINES #ifdef WITH_UNIVERSAL_NEWLINES
{"newlines", (getter)get_newlines, NULL, "end-of-line convention used in this file"}, {"newlines", (getter)get_newlines, NULL,
"end-of-line convention used in this file"},
#endif #endif
{0}, {0},
}; };