Skip to content

Commit

Permalink
stream: Revert to checking for the correct error value.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfalcon committed Jul 22, 2014
1 parent de993f4 commit e1b1abc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion py/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ STATIC mp_obj_t stream_read(uint n_args, const mp_obj_t *args) {
}
int error;
mp_int_t out_sz = o->type->stream_p->read(o, p, more_bytes, &error);
if (out_sz < 0) {
if (out_sz == -1) {
vstr_cut_tail_bytes(&vstr, more_bytes);
if (is_nonblocking_error(error)) {
// With non-blocking streams, we read as much as we can.
Expand Down

0 comments on commit e1b1abc

Please sign in to comment.