Skip to content

Commit e1b1abc

Browse files
committed
stream: Revert to checking for the correct error value.
1 parent de993f4 commit e1b1abc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

py/stream.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ STATIC mp_obj_t stream_read(uint n_args, const mp_obj_t *args) {
9797
}
9898
int error;
9999
mp_int_t out_sz = o->type->stream_p->read(o, p, more_bytes, &error);
100-
if (out_sz < 0) {
100+
if (out_sz == -1) {
101101
vstr_cut_tail_bytes(&vstr, more_bytes);
102102
if (is_nonblocking_error(error)) {
103103
// With non-blocking streams, we read as much as we can.

0 commit comments

Comments
 (0)