Message52512
The latest patch works on Mac OS 10.4 . I would suggest a few cosmetic changes:
1. Put the flag checking logic in a separate function and call it instead of fread. This will eliminate code duplication.
2. "else" is redundant in
+ if (ferror(stream)) {
+ clearerr(stream);
+ PyErr_SetFromErrno(PyExc_IOError);
+ return 0;
+ } else if (feof(stream)) {
+ clearerr(stream);
+ }
The flow will be more obvious if you write
+ if (ferror(stream)) {
+ clearerr(stream);
+ PyErr_SetFromErrno(PyExc_IOError);
+ return 0;
+ }
+ if (feof(stream)) {
+ clearerr(stream);
+ }
3. Please mention bug 1523853 in a comment near the test.
otherwise, the patch looks fine.
|
|
Date |
User |
Action |
Args |
2007-08-23 15:58:13 | admin | link | issue1706039 messages |
2007-08-23 15:58:13 | admin | create | |
|