@@ -839,21 +839,21 @@ file_writelines(f, args)
839839}
840840
841841static PyMethodDef file_methods [] = {
842- {"close" , (PyCFunction )file_close , 0 },
843- {"flush" , (PyCFunction )file_flush , 0 },
844- {"fileno" , (PyCFunction )file_fileno , 0 },
845- {"isatty" , (PyCFunction )file_isatty , 0 },
846- {"read" , (PyCFunction )file_read , 1 },
847842 {"readline" , (PyCFunction )file_readline , 1 },
848- {"readlines" , (PyCFunction )file_readlines , 1 },
843+ {"read" , (PyCFunction )file_read , 1 },
844+ {"write" , (PyCFunction )file_write , 0 },
845+ {"fileno" , (PyCFunction )file_fileno , 0 },
849846 {"seek" , (PyCFunction )file_seek , 0 },
850847#ifdef HAVE_FTRUNCATE
851848 {"truncate" , (PyCFunction )file_truncate , 0 },
852849#endif
853850 {"tell" , (PyCFunction )file_tell , 0 },
854- {"write" , (PyCFunction )file_write , 0 },
855- {"writelines" , (PyCFunction )file_writelines , 0 },
856851 {"readinto" , (PyCFunction )file_readinto , 0 },
852+ {"readlines" , (PyCFunction )file_readlines , 1 },
853+ {"writelines" , (PyCFunction )file_writelines , 0 },
854+ {"flush" , (PyCFunction )file_flush , 0 },
855+ {"close" , (PyCFunction )file_close , 0 },
856+ {"isatty" , (PyCFunction )file_isatty , 0 },
857857 {NULL , NULL } /* sentinel */
858858};
859859
@@ -1027,4 +1027,6 @@ PyFile_WriteString(s, f)
10271027 Py_DECREF (v );
10281028 return err ;
10291029 }
1030+ else
1031+ return -1 ;
10301032}
0 commit comments