Commit 8b73542c authored by Jeremy Hylton's avatar Jeremy Hylton

Reflow long lines.

parent 794643c3
......@@ -90,7 +90,8 @@ dircheck(PyFileObject* f)
#else
char *msg = "Is a directory";
#endif
PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(is)", EISDIR, msg);
PyObject *exc = PyObject_CallFunction(PyExc_IOError, "(is)",
EISDIR, msg);
PyErr_SetObject(PyExc_IOError, exc);
return NULL;
}
......@@ -755,7 +756,8 @@ file_readinto(PyFileObject *f, PyObject *args)
while (ntodo > 0) {
Py_BEGIN_ALLOW_THREADS
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
if (nnow == 0) {
if (!ferror(f->f_fp))
......@@ -1025,8 +1027,9 @@ get_line(PyFileObject *f, int n)
if (skipnextlf ) {
skipnextlf = 0;
if (c == '\n') {
/* Seeing a \n here with skipnextlf true
** means we saw a \r before.
/* Seeing a \n here with
* skipnextlf true means we
* saw a \r before.
*/
newlinetypes |= NEWLINE_CRLF;
c = GETC(fp);
......@@ -1544,9 +1547,9 @@ static PyMethodDef file_methods[] = {
#endif
{"tell", (PyCFunction)file_tell, METH_NOARGS, tell_doc},
{"readinto", (PyCFunction)file_readinto, METH_VARARGS, readinto_doc},
{"readlines", (PyCFunction)file_readlines, METH_VARARGS, readlines_doc},
{"xreadlines", (PyCFunction)file_getiter, METH_NOARGS, xreadlines_doc},
{"writelines", (PyCFunction)file_writelines, METH_O, writelines_doc},
{"readlines", (PyCFunction)file_readlines,METH_VARARGS, readlines_doc},
{"xreadlines",(PyCFunction)file_getiter, METH_NOARGS, xreadlines_doc},
{"writelines",(PyCFunction)file_writelines, METH_O, writelines_doc},
{"flush", (PyCFunction)file_flush, METH_NOARGS, flush_doc},
{"close", (PyCFunction)file_close, METH_NOARGS, close_doc},
{"isatty", (PyCFunction)file_isatty, METH_NOARGS, isatty_doc},
......@@ -1594,7 +1597,9 @@ get_newlines(PyFileObject *f, void *closure)
case NEWLINE_CR|NEWLINE_LF|NEWLINE_CRLF:
return Py_BuildValue("(sss)", "\r", "\n", "\r\n");
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;
}
}
......@@ -1603,7 +1608,8 @@ get_newlines(PyFileObject *f, void *closure)
static PyGetSetDef file_getsetlist[] = {
{"closed", (getter)get_closed, NULL, "True if the file is closed"},
#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
{0},
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment