diff options
| author | Scott Shawcroft <scott@chickadee.tech> | 2016-08-23 16:51:47 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@chickadee.tech> | 2016-08-23 16:51:47 -0700 |
| commit | dea22b0b5db46702777e8baa41dc8bf985b34672 (patch) | |
| tree | 661dc55c4c4efddc4f3c4f8974c9bde176dd8c48 /py | |
| parent | 9485634d41369e896a0ef0f7504f2195b68679e7 (diff) | |
| parent | 656207645485295477411224fdf41cfd4d598a88 (diff) | |
Merge remote-tracking branch 'micropython/master'
Diffstat (limited to 'py')
| -rw-r--r-- | py/stream.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/py/stream.c b/py/stream.c index 473eb9690..eef9080b7 100644 --- a/py/stream.c +++ b/py/stream.c @@ -94,8 +94,8 @@ mp_uint_t mp_stream_rw(mp_obj_t stream, void *buf_, mp_uint_t size, int *errcode } const mp_stream_p_t *mp_get_stream_raise(mp_obj_t self_in, int flags) { - mp_obj_base_t *o = (mp_obj_base_t*)MP_OBJ_TO_PTR(self_in); - const mp_stream_p_t *stream_p = o->type->protocol; + mp_obj_type_t *type = mp_obj_get_type(self_in); + const mp_stream_p_t *stream_p = type->protocol; if (stream_p == NULL || ((flags & MP_STREAM_OP_READ) && stream_p->read == NULL) || ((flags & MP_STREAM_OP_WRITE) && stream_p->write == NULL) @@ -167,7 +167,7 @@ STATIC mp_obj_t stream_read_generic(size_t n_args, const mp_obj_t *args, byte fl // TODO what if we have read only half a non-ASCII char? vstr_cut_tail_bytes(&vstr, more_bytes - out_sz); if (out_sz == 0) { - break; + break; } } |
